Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu

Scripts - Workspace variables

The value of a workspace variable is not stored in the spreadsheet, but in a separate memory space.

A new workspace variable is created by assigning a value to a valid variable name.

A variable name must adhere to the following rules:

A value is assigned to a variable using the = operator.

The following script code creates a variable sum and assigns the value 11 to it:

sum=5+6;

Workspace variables are untyped and may contain numeric values, strings, complex numbers, matrices, or tables.

num=5;
str="A string is placed in double quotes";
nstr='or single quotes';
cmplx=5+3i;
mtrx={5,6,3|1,8,9};

Clear mem command

The Clear mem command deletes or clears all workspace variables.

See also