Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions page (login required).


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