DIM
FUNCTION
This command is used to define a numeric array of one, two, or three dimensions by establishing a unique subscripted variable name for each element of the array. The DIM command is also used to define a string of a specified length and fill it with blanks or with a preset character.
SYNTAX
DIM array-name [#-of-entries [, #-of-entries [, #-of-entries]]] [(length, ["preset-character"])] [,array-name . . .]
DIM string-variable (length [, "preset-character"]) [, string-variable ...]- array-name
- a string, numeric, or integer array name.
- #-of-entries
- an integer value specifying the number of entries for each dimension of the array.
- string-variable
- a variable name.
- length
- an integer specifying the number of characters assigned for string length.
- preset-character
- an alphanumeric or special character used to fill the string.
NOTES
- An array must be dimensioned in a script before it is used.
- Memory space used to store an array or string may be released by redimensioning it to 0.
- More than one variable may be dimensioned in a statement by separating the variable names with commas.
EXAMPLES
DIM S$(60) ! creates 60-character space-filled stringDIM S$[60] ! creates 60-element string arrayDIM S$(60, "A") ! creates 60-character string filled with "A"DIM S$(0) ! clears stringDIM S$[2,5] ! creates 2-dimensional string arrayDIM S$[0] ! clears string arrayDIM N[12,12,12] ! creates 3-dimensional numeric arrayDIM N[0] ! clears numeric arraySEE ALSO
DIMF, description of DIM directives in the Thoroughbred Basic Language Reference
From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF