|Purpose:||Define array variables|
|Format:||SETARRAY [/= /F /T:type /R filename [/Z] arrayname] name[a[,b[,c[,d]]]] [...]|
You can define up to 4-dimensional arrays. For example, to define a 5-row by 10-column array:
The array elements are addressed in base 0, so to reference this array you would use 0-4 for the rows and 0-9 for the columns.
You can initialize arrays by appending [value] to the definition. For example, to initialize all of the array elements to 0:
setarray myarray 
To set the variable elements, use the SET command.
If you don't enter any arguments, SETARRAY will display the currently defined arrays. If you don't enter any dimensions, SETARRAY will display the definition for that array. You can use wildcards in the array name.
See also @ARRAYINFO.
|/=||Display the SETARRAY command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.|
|/R||Read a file into a 1-dimensional array. SETARRAY will automatically determine the required size of the array. You cannot combine /R with any other options.|
|/T:type[:"regexpression"]||Set a variable type. If you try to set the variable to an incompatible type, SET will return an error. The supported types are:|
|int (or 1)||The variable can only contain 0-9|
|dec (or 2)||The variable can only contain 0-9, the decimal character, and the thousands separator|
|hex (or 3)||The variable can only contain 0-9 and A-F|
|bool (or 4)||The variable can only contain 0 or 1|
|alpha (or 5)||The variable can only contain A-Z and a-z|
|alnum (or 6)||The variable can only contain A-Z, a-z, and 0-9|
|regex (or 7)||The variable must match the specified regular expression|
setarray /z myarray[8,3]
You cannot change the number of dimensions in an array.