Extensions Dimension Size

number array:dimSize ( number dindex )

Returns the size of one of the array's dimensions.

Parameters

dindex Index of one of the array's dimensions 

Return Values

number Size of the dimension

Example

-- Create 3D array of doubles
local arr = array.new(20, 40, 60)
 
-- Assert that our dimensions are the right size
assert(arr:dimSize(1) == 20)
assert(arr:dimSize(2) == 40)
assert(arr.dimSize(3) == 60)

Copyright 2010 Justin Aquadro