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


Declares variables.


Dim varname[, varname] . . .


The Dim statement syntax has these parts:

varname Name of the variable; follows standard variable naming conventions.


Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.

All uninitialized variables are treated as zero-length strings ("").


The following examples illustrate the use of the Dim statement:

Dim MyStr        ' Declare one variable
Dim MyVar, MyNum ' Declare two variables
Copy code to clipboard


Caché Basic does not require the dimension of arrays to be specified, and therefore does not implement the ReDim Statement.

See Also

  • Set Statement