Difference between revisions of "Array"

From Second Life Wiki
Jump to navigation Jump to search
Line 3: Line 3:


Example for a standard array :
Example for a standard array :
array EXAMPLE = ["apple" , "banana", "strawberry"];
array EXAMPLE = ["apple" , "banana", "strawberry"];
here EXAMPLE[1] = "banana"
here EXAMPLE[1] = "banana"


Line 9: Line 11:


array ASSOCIATIVE;
array ASSOCIATIVE;
ASSOCIATIVE["fruit"] = "apple";
ASSOCIATIVE["fruit"] = "apple";
ASSICIARIVE["beverage"] = "coffee";
ASSICIARIVE["beverage"] = "coffee";
ASSOCIATIVE["meat"] = "chicken";
ASSOCIATIVE["meat"] = "chicken";




Functions:
Functions:
{{LSLG|llForeach}}
{{LSLG|llForeach}}

Revision as of 01:03, 27 July 2007

An array is a data structure consisting of a group of elements having a single name that are accessed by indexing. These elements can be of all other types like float, string or vector.

Example for a standard array :

array EXAMPLE = ["apple" , "banana", "strawberry"];

here EXAMPLE[1] = "banana"

Example for an associative array :

array ASSOCIATIVE;

ASSOCIATIVE["fruit"] = "apple";

ASSICIARIVE["beverage"] = "coffee";

ASSOCIATIVE["meat"] = "chicken";


Functions:

llForeach