preArrayInc
preArrayInc(g_arrayg_index) =>n_newValue
Description
Takes an array or an associated table element with an index g_index, increments its value by one, stores the new value back into the array, and returns the updated value. This function is a prefix form of ++s.
If the associated table element is not a number or g_index is not valid, it returns an error.
Arguments
Value Returned
Examples
a = vector(1 2 34)
array@0x8382028
preArrayInc(a 2)
=> 35
preArrayInc(a -4)
*Error* setarray: array index out of bounds -
preArrayInc(a -4)
Related Topics
Return to top