The dataarray( function creates a data array from zero or more separate values (see Data Arrays).


This function has one parameter:

value – a value to add to the collection. This parameter can be repeated for as many values as necessary.


This function takes zero or more separate values and combines them into an data array. This example combines four values into a single array. The resulting array can be stored in a variable or in a binary field.

local myarray
myarray = dataarray("Bob",123,3.14159,"Green")

Later, individual values can be extracted from the field using the array( function.

array(myarray,1) ☞ "Bob"
array(myarray,2) ☞ 123
array(myarray,3) ☞ 3.14159
array(myarray,4) ☞ "Green"

If all of the supplied values are text, the dataarray( function will set the default value of the array to "" (empty text). If all of the values are integers the default value will be 0, the same for all floating point values. The default value will be used if you ask the array( function for a value that doesn’t exist. If the values supplied to the dataarray( function are of multiple types, the default value will be an error.

See Also


10.0NewNew in this version.