Skip to main content

setValue (Function)

Function returns the updated list after replacing the element in the given index by the given value.

Syntax

<OBJECT> list:setValue(<OBJECT> list, <INT> index, <OBJECT|INT|LONG|FLOAT|DOUBLE|BOOL|STRING> value)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
listThe list to which the value should be updated.OBJECTNoYes
indexThe index in which the value should to be updated.INTNoYes
valueThe value to be updated with.OBJECT INT LONG FLOAT DOUBLE BOOL STRINGNoYes

Example 1

list:set(stockSymbols, 0, 'IBM')

Function returns the updated list after replacing the value at 0th index with the value IBM.