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. |
|
|