Download Origin 5 LabTalk Developer`s Guide
Transcript
Chapter 4, Application Development
[Main]
if (run.section(,Init, cc ee ii jj)==0)
{
if (run.section(,Input, cc ee ii jj)==0)
{
//get input from the user
run.section(,Calcpoly, cc ee);
//Create a new function
run.section(,Plot, 200 jj);
//Plot the data as line
run.section(,DeleteVars);
//Delete created variables
}
else
{
run.section(,DeleteVars);
//Delete created variables
return;
}
}
[Init]
%A=My Graph;
%W=%H;
%1=3.5;
%2=2;
%3=0;
%4=1;
return 0;
//Store current window name into %W
//This is the constant in the function
//This is the exponent
//Return value of 0 to indicate success
[Input]
getnumber
(Const) %1
(Exp) %2
(Options) %3:2s
Color %4:@C
(Graph Title) %%A
(MyFunc(X)=Const * X^Exp);
return 0;
4.2 The LabTalk Development Environment • 107