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
 usage: worksheet -s
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

HannesK

Posts

Posted - 07/05/2007 :  04:29:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7
Operating System: Win XP


Ladies and Gentlemen,

I'd like to create some graphics inside of a "for"-environment. The data of interest has to be selected via "worksheet -s ...", I guess. Then, one can plot like "worksheet -p ..." Unfortunately, i cannot get Labtalk running like

worksheet -s $(ii+1) 0 $(ii+1) 0;
worksheet -p 200 template;

whereas

worksheet -s 2 0 2 0;
worksheet -p 200 template;

works fine. Thus, the problem looks like how one has to implement the index "ii" into the "worksheet -s ..." command correctly.

Thank you very much for any help
reg
Hannes

Mike Buess

USA
3037 Posts

Posted - 07/05/2007 :  08:56:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hannes,

The following script works perfectly for an XYYYY worksheet in O70 SR4.

%W=%H;
for(ii=1;ii<=4;ii++) {
win -a %W;
wo -s $(ii+1) 0 $(ii+1) 0;
wo -p 200;
}

However, the $() notation is not really necessary in this case. The following commands work just as well...

wo -s ii+1 0 ii+1 0;
wo -s (ii + 1) 0 (ii + 1) 0; // parenthesis needed because of spaces surrounding the plus symbols


Finally, you can use the wks.colsel() method to select individual columns...

wo -s; // unselect all columns
wks.colsel(ii+1); // select column ii+1

Mike Buess
Origin WebRing Member
Go to Top of Page

HannesK

Posts

Posted - 07/06/2007 :  08:06:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,
thanks a lot. All the commands you suggested work fine. In fact, one tiny semicolon set my for-loop out of duty:

for(ii=1;ii<=(cols-1);ii++); // <- no semicolon here!
{
win -a main;
wo -s; // unselect all columns
wks.colsel(ii+1);
worksheet -p 200 BasicLinLin;
};

Beginner's mistake. Sorry and thanks a lot

Hannes
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