Next: Properties
Up: FFish Script Objects Reference
Previous: arguments
Contents
Array Object
Description
Provides support for creation of arrays of any data type.
Syntax
- [.]new Array()
- [.]new Array(size)
- [.]new Array(element_0, element_1, ..., element_n)
- [.] [element_0, element_1, ..., element_n]
Parameters
- size
- The size of the array. As arrays are zero-based, created elements will have indexes from zero to size - 1
- element_0, element_1, ..., element_n
- The elements to place in the array. This creates an array with n + 1 elements.
Remarks
Ffish script only supports one dimension array. To access the elements
of an array, use the array access operator ([ ]).
Example
a = new Array();
//the length of a is 0
a = new Array("e", "f", "g", "h");
//the length of a is 4
b = [1, 2, 3, 4];
//the length of b is 4
Subsections
Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.