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
 Using 'run'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dntsmzns

Lithuania
2 Posts

Posted - 10/27/2010 :  09:11:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: OriginPro 8 SR0 / v8.0724 (B724)
Operating System: Win7 64-bit

Hello, world

I have a script that uploads several files from a given folder, performs certain calculations and plots some graphs. I specify the folder by changing a variable (i.e. ex=0, ex=2, ex=4, ex=6) which is then inserted into a string for the directory.

At the moment my method is to just post the script into the command window, manually change the variable 'ex' and launch the script. This involves a lot of screen clearing, scrolling, etc.

I was wondering if there is an option to set the variable using the 'run' command, so I don't have to paste/edit/launch every time. E.g.,
run C:\script.ogs -option [variable to change] [newvalue]

I assume I'll have to change the script somehow so that it could take the variable from the command.

What's the method here?

Thanks,

*******
* astro *
*******

greg

USA
1379 Posts

Posted - 10/27/2010 :  11:43:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please review the help file for the run.section method.
If your OGS file has sections, then you can run specific sections and you can pass up to five arguments, as in:

run.section(util,ping,Hello 3.14159 9 $(pi) "good bye")

where UTIL.OGS in part looks like:

[Ping]
string Arg1$ = %1;
double Arg2 = %2;
int Arg3 = %3;
double Arg4 = %4;
string Arg5 = %5;
Type -a %(arg1$), $(arg2), $(arg3), $(arg4), %(arg5$);

Note that if you do not declare a type for a numeric variable, as in
value = 3;
then it becomes global and your OGS file can reference it directly with no need to pass.
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