Purpose:Define array variables

 

Format:SETARRAY [/F /T:type /R filename arrayname] name[a[,b[,c[,d]]]] [...]

 

a,b,c,dArray dimensions

 

/F(orce overwrite)

/R(ead)

/T(ype)

 

Usage:

 

You can define up to 4-dimensional arrays. For example, to define a 5-row by 10-column array:

 

setarray array1[5,10]

 

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.

 

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.

 

Options:

 

/FForce overwrite of existing array (if any).

 

/RRead a file into a 1-dimensional array. SETARRAY will automatically determine the required size of the array.

 

/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