replace value in list(a,b,c)


Replaces the value at position a of a Named List b with the new value c.

If an invalid position number is specified, the function aborts with an error.

The return value of the function is the value that has been replaced.

Description of Parameters


Parameter

Description

a

Position in list. Offset is 1.

b

(optional) Name of list. Default: default.

c

New value.


Examples


Defined is a list myList with values {value, val1;val2}.


Parameter a

Parameter b

Parameter c

Result

Values in list

1

myList

newvalue

value

{ newvalue,val1;val2 }

2

myList

val3;val4

val1;val2

{ value,val3;val4 }

0

myList

newvalue

Function terminates with an error.

{ value,val1;val2 }

3

myList

newvalue

Function terminates with an error.

{ value,val1;val2 }