The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 before formula script : index value of range

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bedibra Posted - 08/25/2017 : 7:00:57 PM
Dear all,
I am looking for a way to get index value of a range of data present in col(A) and put the index values in col(B).
Thanks for the help
4   L A T E S T    R E P L I E S    (Newest First)
bedibra Posted - 08/28/2017 : 6:45:21 PM
Yes this is perfect. thanks
Chris D Posted - 08/28/2017 : 10:09:34 AM
Hi,

You can use the size of the range that would point to the column. e.g.:

range rCol = col(A);
int nIndex = rCol.GetSize();

nIndex=; // output just for testing.


However, this does not take into account if the last row (or rows) are missing values (--) which can readily happen.
To do that you'd have to do a simple loop backwards until encountering a value in the column that isn't a missing value:

range rCol = col(A);
int nSize = rcol.GetSize();
nIndex = 0;
for (int ii = nSize; ii > 0; ii--)
{
	if (!ISNA(rCol[ii]))
	{
		nIndex = ii;
		break;
	}
}
nIndex=; // output just for testing.


I hope this helps.

Thanks,
Chris Drozdowski
Originlab Technical Support
bedibra Posted - 08/28/2017 : 08:04:31 AM
well, what I want exactly is to get the index value of the LAST row of a column (see picture) in order to use that value for other calculations. any ideas ???


quote:
Originally posted by nick_n

quote:
Originally posted by bedibra

Dear all,
I am looking for a way to get index value of a range of data present in col(A) and put the index values in col(B).
Thanks for the help



Could you describe your problem more? I'm little bit confusing by "index value of a range of data". Probably "list" LT function could help you. http://www.originlab.com/doc/LabTalk/ref/List-func

Nikolay

nick_n Posted - 08/26/2017 : 5:10:31 PM
quote:
Originally posted by bedibra

Dear all,
I am looking for a way to get index value of a range of data present in col(A) and put the index values in col(B).
Thanks for the help



Could you describe your problem more? I'm little bit confusing by "index value of a range of data". Probably "list" LT function could help you. http://www.originlab.com/doc/LabTalk/ref/List-func

Nikolay

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000