This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
4rpl:commands:setlistelement [2021/01/08 16:01] – external edit 127.0.0.1 | 4rpl:commands:setlistelement [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOTOC~~ | + | < |
- | < | + | < |
+ | <WRAP tabs> | ||
+ | * [[4rpl: | ||
+ | * [[4rpl: | ||
+ | </ | ||
====== SetListElement ====== | ====== SetListElement ====== | ||
+ | |||
SetListElement(< | SetListElement(< | ||
===== Description ===== | ===== Description ===== | ||
+ | |||
Stores a value at the specified index of a list. The previously stored value is overwritten. | 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 -> | + | If a list is stored in a variable, this can be abbreviated to '' |
+ | |||
+ | For doing the same thing but with arguments in order of **value, list**, **index**, see [[4rpl: | ||
===== Examples ===== | ===== Examples ===== | ||
+ | |||
<code 4rpl> | <code 4rpl> | ||
- | Split("1,2,3,4,5,6" "," | + | 1 2 3 4 5 6 ListN(6) -> |
- | SetListElement(<-list 2 "G") | + | 1 2 3 4 5 6 ListN(6) ->list2 |
- | "R" ->list[4] | + | |
- | Trace(<-list) | + | 0 -> |
+ | |||
+ | SetListelement(<-list1 < | ||
+ | # does the same as | ||
+ | "one" ->list2 [<-index] | ||
+ | |||
+ | < | ||
+ | <-list2 Trace | ||
+ | |||
+ | # OUTPUT: | ||
+ | # [one, 2, 3, 4, 5, 6] | ||
+ | # [one, 2, 3, 4, 5, 6] | ||
</ | </ | ||
+ | |||
< | < | ||
+ | |||
+ | ~~NOTOC~~ | ||