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
 Origin Forum
 LabTalk: Accessing columns fails

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
marko Posted - 01/27/1999 : 2:30:00 PM
I am using Origin 5.0.
Accessing columns in my multicolumn worksheets fails for certain columns.
Doing something like '%s_Em(27)=' gives another value as '%(%s,3,27)=' which should actually be the same!!! What goes wrong here?
It seems to be VERY DANGEROUS to use the names of columns in accessing single data cells... Any suggestions???
3   L A T E S T    R E P L I E S    (Newest First)
marko Posted - 02/01/1999 : 12:29:00 PM
I am so stupid! I just used the wrong parentheses... I didn't notice... Funny that
the thing worked normal in another part of
my script since I did compare two in this manner interpolated values...
Thanks.
Marko
Gary Lane Posted - 02/01/1999 : 7:25:00 PM
Hi,

On page 18 of the Origin 5.0 LabTalk manual two methods to access individual dataset elements are described. Use either the datasetname[i] notation (with square brackets) or the %(WorksheetName,ColumnNumber,RowNumber) notation. See also page 19 of the Origin 5.0 LabTalk manual where Using Datasets as Functions is documented. The syntax datasetname(x) actually returns an interpolated value of the Y dataset datasetname for a given X value. Generally, in Origin, square brackets are used to index datasets and parentheses are used to indicate "function of."

In your specific case, %s_EM(27) returns the interpolated Y value of the dataset %s_EM whose X value is 27. Try %s_EM[27] which will return the 27th element of the dataset %s_EM (which will equal %(%s,3,27)).

Thanks for this question...I'm sure others have made this same mistake...I know I did. This actually points out a useful (albeit subtle) feature of Origin.

Gary Lane
Technical Support Engineer
Microcal Software


[This message has been edited by Gary Lane (edited 02-01-99).]

[This message has been edited by Gary Lane (edited 02-01-99).]

[This message has been edited by Gary Lane (edited 02-01-99).]

Gary Lane Posted - 02/01/1999 : 5:30:00 PM
Not stupid! As I said its a subtle feature...and others (like me!) have done this same thing before you. Perhaps it worked in a worksheet where there was no X column (By default, if there is no X column then row number i is used for X) or in an X dataset where X=i for all X.

[This message has been edited by Gary Lane (edited 02-02-99).]


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