User Tools

Site Tools


4rpl:commands:setlistelement

Index
Lists

SetListElement

SetListElement(<-list <-index <-value)

Description

Stores a value at the specified index of a list. The previously stored value is overwritten.

If a list is stored in a variable, this can be abbreviated to <-value ->list[<-index].

For doing the same thing but with arguments in order of value, list, index, see SetListElementRPN.

Examples

1 2 3 4 5 6 ListN(6) ->list1
1 2 3 4 5 6 ListN(6) ->list2
 
0 ->index
 
SetListelement(<-list1 <-index "one")
# does the same as
"one" ->list2 [<-index]
 
<-list1 Trace
<-list2 Trace
 
# OUTPUT:
# [one, 2, 3, 4, 5, 6]
# [one, 2, 3, 4, 5, 6]

Index

4rpl/commands/setlistelement.txt · Last modified: 2021/03/02 13:05 by Karsten75