TReverse
The TReverse function reverses the order of values in a table of numbers. The table can be a Lua table or a class object of type CImage or CArray.
table = TReverse( table )
CImage = TReverse( CImage )
CArray = TReverse( CArray )
where
table, CImage, or CArray contains the data to be reversed.
On success, the modified data object is returned, otherwise nil is returned.
All table types except for the CImage class use double precision real numbers with data type "double". The CImage class supports values ranging from byte to double plus other data types. Numeric values other than double can be processed by first converting the table to a CImage.
The following script creates a table containing 1000 integer values in the sequence 1000, ..., 1. First it creates a table consisting of values 1,..., 1000 and then reverses their order.
|
-- create a table of [1,1000] in reverse order |