Last month, I discussed three basic syntax elements: variables, constants, and subtypes. However, I intentionally didn't discuss an important subtype: Array. This month, I take a close look at what Array variables, or simply arrays, are and how you can create, fill, resize, traverse, erase, split, and join them. I also cover multidimensional and nested arrays.
Arrays in VBScript
Unlike all the other subtypes I showed you last month, an array can hold more than one value. An array lets you address many data values through the same variable. Think of an array as a list (e.g., a list of usernames). You reference each item in this list with a common name and index number. The common name is the name of the array variable. The common name typically includes the prefix arr to denote that the variable contains data of the subtype Array. The index number is an integer subscript that denotes an item's relative location in the list. The indexes always increment sequentially, starting from 0. For example, if an array has three items, the indexes are 0, 1, and 2. The 0 index represents the first position, the 1 index represents the second position, and the 2 index represents the third position in the array. . . .
Shefali Sinha March 27, 2002