Array: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
JwellsNB (talk | contribs)
No edit summary
Line 5: Line 5:
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 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.


== Example ==
== Example (BASIC) ==


<pre>
<pre>
Line 15: Line 15:
'Access the array and concatenate elements
'Access the array and concatenate elements
Print MyArray(0) & " " & MyArray(1)
Print MyArray(0) & " " & MyArray(1)
</pre>
== Example (JavaScript) ==
<pre>
//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] + "<br>");
</pre>
</pre>



Revision as of 18:54, 21 April 2013

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.

Example (BASIC)

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)

Example (JavaScript)

//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] + "<br>");

Output

Hello World!

Related Items

Dim