- Found in:
- JContainers
intfunctionfetchAddInt(intobject, stringpath, intvalue, intinitialValue=0, boolcreateMissingKeys=false, intonErrorReturn=0)NativeGlobal
Description
Documentation Comment
A group of the functions that perform various math on the value at the @path of the container. Returns previos value:
T previousValue = container.path
container.path = someMathFunction(container.path, value)
return previousValue
If the value at the @path is None, then the @initialValue being read and passed into math function instead of None.
If @createMissingKeys is True, the function attemps to create missing @path elements.
Parameters
intobject
stringpath
intvalue
intinitialValue=0
boolcreateMissingKeys=false
intonErrorReturn=0
Examples
Auto-Generated Example
int myInt__object
string myString__path
int myInt__value
int myInt__initialValue
bool myBool__createMissingKeys
int myInt__onErrorReturn
int returnedValue = JAtomic.fetchAddInt(myInt__object, myString__path, myInt__value, myInt__initialValue, myBool__createMissingKeys, myInt__onErrorReturn)