Scripts - Operators and functions
Operators
In addition to the operators listed on Operators, MedCalc scripts provide additional Increment and Decrement operators.
Increment operator ++
The increment operator ++ adds 1 to a variable, and the decrement operator -- subtracts 1 from it.
The variable must be a worksheet variable (not a spreadsheet cell).
The following statement increases the value of variable a by 1:
a++;
For example:
a=5; a++; ?a;
will display 6.
Decrement operator −−
The following statement decreases the value of variable a by 1:
a−−;
Operators on matrices
See the corresponding section on the Matrices page.
Mathematical and other functions
In the script all spreadsheet functions can be used in simple or more complex expressions, e.g.
a=90; s=sin(90); // x=4; y=3; z=sqrt(power(x,2)+power(y,2));
Note that the length of an expression cannot exceed 240 characters.