Extensions Get Value

mixed object.get ( [number x [, number y [, number z] ] ] )

Returns either a number or a string from a slot in the array, depending on the array's type.  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.

Parameters

x Optional.  Index in X dimension
y Optional.  Index in Y dimension
z Optional.  Index in Z dimension

Return Values

mixed Value (number or string) of requested array slot

Example

-- Assume we have an array object "arr"
-- Get value at (X=3,Y=2,Z=1)
local v1 = arr.get(3, 2, 1)
 
-- Get same value using internal indexes
arr.curX = 3
arr.curY = 2
arr.curZ = 1
local v2 = arr.get()
 
-- The values should be the same
assert(v1 == v2)

Copyright 2010 Justin Aquadro