--- title: "replace value in list()" slug: "basic-replace-in-list" updated: 2026-08-12T08:49:56Z published: 2026-08-12T08:49:56Z canonical: "docs.lobstersoftware.com/basic-replace-in-list" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # replace value in list() This function replaces the value at position **a** of 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. ## 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} |