postArraySet
postArraySet(g_arrayg_indexn_modifier) =>n_oldValue
Description
Takes an array or an associated table element with an index g_index, adds an n_modifier value to its original value, stores the new value back into the array, and returns the original value.
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
postArraySet(a 2 3)
=> 34
postArraySet(a -4 9)
*Error* setarray: array index out of bounds -
postArraySet(a -4 9)
Related Topics
Return to top