Assignment-stmts
The assignment statement takes the general form:
LHS = expression ;
expression (RHS, right-hand side) is evaluated and put into LHS (left-hand side). If LHS does not exist, it is created if possible, otherwise an error will be reported.
col(A)=3; //every value of col(A) set to 3 Book1_B=100; //every value of column B in Book1 set to 100
col(C) = col(B)*2.5; //column B times 2.5 and assign to column C
ds1={1.2, 3.4, 5.6}; //create a dataset begin=ds1; //assign 1st value in ds1 to begin
name$=Amplitude; //name$ will be assigned to "Amplitude" fn$=system.path.program$ + "Samples\Spectroscopy\HiddenPeaks.dat";
wks.ncols=5; //set number of columns in worksheet to 5 wks.name$=MyInput; //set current sheet name to "MyInput" Book1!wks.rhw=100; doc -uw; //set row header height to 100 and refresh.
%A = "%YTest.opju" concatenate %Y and Test.opju and assign to %A
Note: If a string register to the left of the assignment operator is enclosed in parentheses, the string register is substitution processed before assignment. For example:
ds={1.2, 2.3, 3.4}; %B=ds; (ds)=2*%B; //ds times 2 and put back to ds, '''%B''' still holds the string "ds". type $(ds); //will output new ds values 2.4 4.6 6.8