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 for Programming
 LabTalk Forum
 Plot looping problem

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
Smith_Panther Posted - 12/02/2015 : 08:58:07 AM
Origin Ver. and Service Release: 8.6.0G (32-bit) Sr3
Operating System: Win 7 32-bit

Hello,

I have a strange issue regarding execution of script fragments inside conditional loops.

For example, I want to plot several curves in to a graph template using the following code:

win -a Book5;
samples = wks.ncols;
win -t plot "%Y\stala_hd_templates\transfer_lin_hd.otp" "Transfer";
for (ii=2; ii<samples-2; ii=ii+3)
{
plotxy iy:=[Book5]1!(1,wCol($(ii))) plot:=200 ogl:=1;
};

If I put this code in an .ogs file and execute it inside the command window typing "run *.ogs" it doesn't work correctly. Only the last curve from the worksheet is beeing plotted. The other iterations of the for loop are missing.

On the other hand, if I put exactly the same code directly into the command window it works perfectly. All curves will be plotted out of each for loop iteration.

So what's the reason for that issue? Why the loop function doesn't work inside an *.ogs file?
At the end I want simply to loop through the worksheet and plot specific columns. However, every file has different amount of columns, so I have to use a loop structure and want to save it in .ogs file to create a button.

I hope somebody can help me to solve this problem. Thanky you very much.

Kind regards,
Smith
2   L A T E S T    R E P L I E S    (Newest First)
Smith_Panther Posted - 12/03/2015 : 02:59:57 AM
Thank you very much for this hint, it works when I use the run.file() expression!

Khosrove Posted - 12/02/2015 : 11:15:36 AM
Have your tried run.file(*)?
I'm a beginner here, but I had a similiar problem - tried run *.ogs and it didn't loop right, then tried run.file(*) and it went fine. It also worked fine when used as a script for a button.

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