Array

From NSB App Studio
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Array(expressionlist)

Description

Array creates an array dynamically. The required parameter, expressionlist, is a comma-delimited list of valid expressions. The resulting array has a length equal to the number of elements in expressionlist. Arrays created with Array have a lower bound of 0.

//Array Example
//Array creates an array dynamically

var MyArray, Message;
//Create an array with 2 string elements
MyArray= new Array("Hello", "World!");
//Access the array and concatenate elements
NSB.Print(MyArray[0] + " " + MyArray[1]);

'Rem Array Example
'Array creates an array dynamically

Dim MyArray, Message
'Create an array with 2 string elements
MyArray = Array("Hello", "World!")
'Access the array and concatenate elements
Print MyArray(0) & " " & MyArray(1)

Output

Hello World!

Related Items

Dim, LBound, ReDim, Sort, Splice, Split, UBound