replace value in list(a,b,c)


Replaces the value at position a of a named list with name b by the value c. If no name is specified, default is used. The position number starts with 1. If an invalid number is specified, the function will abort with an error.

The return value 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 lList

1

MyList

newvalue

Value

{newvalue, val1;val2}

2

MyList

val3;val4

val1;val2

{newvalue, val3;val4}

0

MyList

newvalue

Function terminates with an error.

{newvalue, val3;val4}

3

MyList

newvalue

Function terminates with an error.

{newvalue, val3;val4}