Author |
Topic  |
|
HannesK
Posts |
Posted - 07/05/2007 : 04:29:59 AM
|
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
|
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 |
 |
|
HannesK
Posts |
Posted - 07/06/2007 : 08:06:41 AM
|
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 |
 |
|
|
Topic  |
|
|
|