Extensions Set Value

void object.set ( number value, [number x [, number y [, number z] ] ] )

Updates the value of an array slot.  If x, y, or z indecies are not specified, then the current index values (curX, curY, and curZ) will be used.  Requests for values outside of valid index ranges will fail.

Only numeric arrays can be updated.  Calling set on string arrays will be ignored.

Parameters

value New value for the array slot
x Optional.  Index in X dimension
y Optional.  Index in Y dimension
z Optional.  Index in Z dimension

Return Values

None.

Example

-- Assume we have an array object "arr"
-- Set value at (X=3,Y=2,Z=1)
arr.set(50, 3, 2, 1)
 
assert(arr.get(3, 2, 1) == 50)

Copyright 2010 Justin Aquadro