Array Function
Main Menu
Description
Returns a Variant containing an array.

Syntax

Array(arglist)

The required arglist argument is a comma-delimited list of values that are assigned to the elements of an array contained with the Variant. If no arguments are specified, an array of zero length is created.

Remarks
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 variable A. The last statement assigns the value contained in the second array element to another variable.

Dim A
A = Array(10,20,20)
B = A(2)

Note: Array is a method of presetting variables within an array , it is not however the simple method of defining a variable which is an array that is not populated with values. As an example here is the syntax where the defiant variables of "Cdata" and "Ddata" they are allocated as an array of 150 elements each.

Dim Cdata(150),Ddata(15,10)

Tricks: when using ASP in WEB pages a realy usfull think to remeber is that you can define valuse to an array with strings, for example below, and anyone who knows html will start to think of ways that you could use this trick.

tooBB = array(" checked","","")
' tooBB(0) contains
" checked"
'
tooBB(1) contains an Empty string
' tooBB(2) contains an Empty string

related to
IsArray     LBound     UBound      Dim      ReDim


Main Menu