|
Mike Buess
USA
3037 Posts |
Posted - 06/12/2003 : 3:34:05 PM
|
Hi Carl,
To find out what the Add Function Graph command does...
> Open the script window. > Press Ctrl+Shift and select Graph->Add Function Graph
In my Origin 7 SR4 the following shows up in the script window...
Menu id=36120 NewFunction
So one way to run the command is with
menu -e 36120;
That works fine, but menu IDs can change from one version to the next. A more reliable way is to execute the command itself: NewFunction. The syntax for running a section in a script file is run.section(File,SectionName), so NewFunction must either be a macro or an Origin C function. If you open the Programming Guide, go to the Index and type in NewFunction an entry for the NewFunction macro shows up with this definition...
Def NewFunction { doc -cs F;%B=F$(count+1);create %B -f 10; def ErrorProc [del %B];set %B;del -m ErrorProc; };
doc -cs F;// count the number of datasets with names beginning in F. result is saved in the variable count. %B=F$(count+1); // create a new function name create %B -f 10; // create a new function with that name and give it 10 rows def ErrorProc {del %B}; // what to do if the next command results in a command error. (delete the function.) set %B; // open the plot details dialog for the function del -m ErrorProc; // clean up
You can use the NewFunction macro in you labtalk script or just use the particular commands that are appropriate for what you want to do.
Hope that helps.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 06/12/2003 3:37:50 PM |
 |
|