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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 LabTalk: Accessing columns fails
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marko

Germany
112 Posts

Posted - 01/27/1999 :  2:30:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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???

Gary Lane

USA
150 Posts

Posted - 02/01/1999 :  5:30:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 02/01/1999 :  7:25:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

Go to Top of Page

marko

Germany
112 Posts

Posted - 02/01/1999 :  12:29:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000