Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


Assigns a value to a variable.


LET var=expression


var Any valid variable name.
expression Any MVBasic expression that resolves to a value.


The LET statement assigns the value of expression to the variable var. You can perform the same assignment operation by just specifying var=expression without the LET keyword. For further details on assignment operations, refer to the Variables page of this manual.

LET permits value assignment to all valid variable names, including variable names that are keywords. For clarity and compatibility, use of keywords as variable names is discouraged.


The following examples use LET to assign values to the variable x:

LET x=12
LET x="Fred"
LET x="Con":"catenate"
LET x=""
LET x=4+4*3;    ! Returns 16
LET x=(4+4)*3;  ! Returns 24
Copy code to clipboard

See Also