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
 script file execution is strange
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

asafok

Sweden
5 Posts

Posted - 03/14/2019 :  11:24:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2019 64bit trial;
Operating System:windows 10, 64 bit
This script file is working well when run using "execute current section" in the debug menue of the code builder, but when run from the command window using run *.ogs, it behaves strangely: once doc -e W loop is over instead of stopping, it continues and run the sections below.

[main]
run.loadoc(winshow.c);
int i,j;
//string methodtype;
doc -ef W {

type "starting new ittiration";
%W = %H;
String methodtype$=page.longname$;
methodtype$=;
i=methodtype.Match("*Freq*");
j=methodtype.Match("*viscosity*");
//i=;
//j=;
if (j==1) {run.section( , VisPlot);};
else {run.section( , OscPlot);};


};
return;


[OscPlot]
type "OSCPlot";
i=;
string bookname$ = page.longname$;
bookname$=;
range Freq=col(g);
range ElasMod=col(k);
range ViscMod=col(l);
range PHangle=col(n);
plotxy iy:=(7,11:12) plot:=201;
page.longname$=;
page.longname$ = bookname$;
axis -ps X S 1;
layer -g;
layadd type:=rightY linkto:=1;
plotxy [bookname$]sheet1!(7,14) plot:=201 ogl:=2 color:=3;
layer.y.from=0;
layer.y.to=90;
layer.x.from=1;
layer.x.to=60;
Return;

[VisPlot]
type "VisPlot";
string bookname$ = page.longname$;
bookname$=;
range Sreate=col(h);
range Svisc=col(i);
plotxy iy:=(8:9) plot:=201;
Return;

Edited by - asafok on 03/14/2019 11:26:05 AM

yuki_wu

896 Posts

Posted - 03/14/2019 :  9:49:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you use run.file to execute the LabTalk script file, all sections will be execute. You should use run.section to specify the section you want to execute. Please find more info here:
https://www.originlab.com/doc/LabTalk/ref/Run-obj

Regards,
Yuki

OriginLab
Go to Top of Page

asafok

Sweden
5 Posts

Posted - 03/15/2019 :  03:18:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you very much, that solved the issue

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