Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

preArrayDec

preArrayDec( 
g_array 
g_index 
) 
=> n_newValue

Description

Takes an array or an associated table element with an index g_index, decrements 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

g_array

An array or an associated table.

g_index

An index in the array or an associated table.

Value Returned

n_newValue

New value of the element.

Examples

a = vector(1 2 34)
array@0x8382028
preArrayDec(a 2)
=> 33
preArrayDec(a -4) 
*Error* setarray: array index out of bounds -
preArrayDec(a -4)

Related Topics

postdecrement

predecrement

preincrement


Return to top
 ⠀
X