T O P I C R E V I E W |
henglo |
Posted - 03/08/2012 : 10:44:10 PM Origin Ver. and Service Release (Select Help-->About Origin): 8.0.63.988 SR6 Operating System: Windows 7
I have a simple question. When I try to run an x-function from a script file I seem to not be able to add multiple options in separate lines which makes it a lot less readable. A simple example (just as the one in your wiki):
impasc options.ImpMode:=3 options.sparklines:=0;
Origin will not process any of the options below the impasc command. So, in this case sparklines will be ignored. If I shrink it to one line it works. Any ideas? Thanks! |
4 L A T E S T R E P L I E S (Newest First) |
henglo |
Posted - 03/11/2012 : 9:31:36 PM Thank you so much! This explains a lot. It was not clear from the documentation that there's a difference in the way you run the file. |
greg |
Posted - 03/09/2012 : 4:23:02 PM Just a reminder .. When running multiple lines in the Script Window you must use Ctrl+Enter when entering multiple lines and you must select all lines at once to run. For Command Window, you must paste multiple lines all at once and press Enter.
For running OGS files (assuming they are in the User Files Folder - UFF): You can use run.file(x.ogs) run x.ogs will fail because the lines are executed one at a time. Since you declared b as an integer it goes in and out of scope for one line, then 'type' and the 'if' know nothing about b.
If you first let Origin know about new ogs files in the UFF by running dir *.ogs then you can run the file by just entering its name, as in test Curiously, a file named X.OGS cannot be run this way. Probably because Origin has a System Variable named x.
|
henglo |
Posted - 03/09/2012 : 02:27:50 AM I just upgraded to the newest version from our computer centre. It's now 8.5.1 SR2. Seems to not resolve any of my previous questions, but I noticed something else. If I define variable in the script they seem to be forgotten. Simple example x.ogs:
int b=1; type "hello $(b)"; if (b==1) type "succ"; else type "fail";
Now I run it with "run x.ogs" and the output is:
hello -- fail
If I key in the same lines in the command window everything is fine. I must be doing something majorly wrong. |
henglo |
Posted - 03/08/2012 : 11:14:44 PM Sorry, another point which I forgot. How do I run the script as easy as described in the tutorial?
I have a test.ogs in the user directory. The only way to run the script seems to call "run test.ogs". If I call "run test" the message "Initial configuration script file test is missing or not in the software directory" pops up. If I just type "test" (as in the tutorial) the console says "#Command Error!".
Thank you! |