Dim

From NSB App Studio
Revision as of 03:08, 4 July 2012 by Brendon (talk | contribs) (Created page with "DIM ''nameA''[([''subscriptA'' [,''subscriptB'' [,''subscriptC''...]]])] [, ''nameB''...[, ''nameC''..., [...]]] '''Description''' DIM is used to declare va...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DIM nameA[([subscriptA [,subscriptB [,subscriptC...]]])]

               [, nameB...[, nameC..., [...]]]

Description

DIM is used to declare variables and allocate storage space. The required component, nameA, is the name of the variable, it must follow standard variable naming conventions. The optional list of subscripts are the upper bounds of dimensions of an array variable. Up to 60 comma-separated dimensions may be declared. Script level variables are available to all procedures in the script; procedure level variables are available only in the procedure they are declared in. The lower bound of an array is always zero.

Example

REM DIM Example
'DIM declares variables and allocatesstorage
'An empty variable named "Foo"
DIM Foo
'A one-dimensional array with 10 elements
DIM OneD(9)
'A two-dimensional array with 600 elements
'20 x 30
DIM TwoD(19, 29)

Related Items

ARRAY, REDIM, SET