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 for Programming
 LabTalk Forum
 Limit function using strings as input
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JulesOZ

18 Posts

Posted - 04/01/2013 :  9:38:38 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9
Operating System: Win7

Dear all,
I have a very basic question:
I'd like to use the Limit function to get the maximum value of a certain column. Because I'm looping through a bunch of worksheets and workbooks I have the names of the stored in strings and alternatively I have the worksheet index. The name of the column, where I search for the maximum is always the same.
Can somebody tell me what the syntax is to get the Limit function working? I tried stuff like:

limit %([Bname$]!wks.col$(kk).backgr);

or limit %[Bname$]sIndex$_backgr;

or limit %[Bname$]$(kk)_backgr;

and a lot of other combinations.
But as I always get "Command error" messages, I guess I'm very much on the wrong track.

greg

USA
1378 Posts

Posted - 04/02/2013 :  11:24:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Range syntax:
[<Book Long or Short Name>]<Sheet name or index>!<column name or index>
is (almost) exclusively used for defining ranges and cannot be used for direct addressing.


% notation also expects some valid substitution and none of your examples are valid.

Here is an example that loops over three sheets (using sheet index) in a workbook:

string BkName$ = Book9;
loop(ii,1,3)
{
range ra = [BkName$]$(ii)!backgr;
limit ra;
limit.ymin=;
limit.ymax=;
}
Go to Top of Page

JulesOZ

18 Posts

Posted - 04/02/2013 :  7:27:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot. That works very well!
I often stumble over syntax stuff like this and so far I found it difficult to find the helpful bits in the programming help. Can you maybe recommend a good overview about this?
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