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
 Using 'run'

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
dntsmzns Posted - 10/27/2010 : 09:11:38 AM
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 *
*******
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/27/2010 : 11:43:10 AM
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.

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