Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Array - function of language VBScript

Description:
Returns 1-dim array of values.
Syntax:
Array(arglist As Variant) As Array
Calling:
a = Array(arglist)
Parameters:
arglist(Variant) Comma-delimited list of values that are assigned to the elements of an array. If no arguments are specified, an array of zero length is created.
Note:

The notation used to refer to an element of an array consists of the variable name followed by parentheses containing an index number indicating the desired element. In the following example, the first statement creates a variable named A. The second statement assigns an array to this variable. The last statement assigns the value contained in the second array element to another variable.

Dim A
A = Array(10, 20, 30)
B = A(1) 'B=20
 
A variable of the array type can be created directly by the Dim command. This array can be accessed in the same way. Example
Dim A(2)
A(0) = 10 : A(1) = 20 : A(2) = 30
B = A(1) 'B=20
 
Caution: The Array function creates only 1-dimensional arrays. For creating multidimensional arrays it is necessary to use the Dim and ReDim commands.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice