User Tools

Site Tools


4rpl:commands:settableelement

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:settableelement [2021/01/14 16:16] – [Examples] fixed syntax error, missing " Sanian4rpl:commands:settableelement [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]]+<=[[4rpl:start| Index]] \\ 
 +<=[[4rpl:start#tables| Tables]] 
 + 
 +<WRAP tabs> 
 +  * [[4rpl:commands:GetTableElement|Get]] 
 +  * [[4rpl:commands:SetTableElement|Set]] 
 +</WRAP>
  
 ====== SetTableElement ====== ====== SetTableElement ======
-SetTableElement(<-table <-key <-value+SetTableElement(<-table <-key <-value)
  
 ===== Description ===== ===== Description =====
 Sets an element in a table. Note that keys are case sensitive strings. Sets an element in a table. Note that keys are case sensitive strings.
 +
 +For doing the same thing but with arguments in order of **value**, **table**, **key**, see [[4rpl:commands:settableelementrpn|SetTableElementRPN]].
 +
 A special syntax can also be used to set a table element. See the example below. A special syntax can also be used to set a table element. See the example below.
  
Line 12: Line 21:
  
 <code 4rpl> <code 4rpl>
- CreateTable ->table +CreateTable ->table 
- SetTableElement(<-table "SomeKey" 42) +SetTableElement(<-table "SomeKey" 42) 
- trace(GetTableElement(<-table "SomeKey") #prints "42"+GetTableElement(<-table "SomeKey"Trace  # prints "42"
  
- #alternate syntax +# alternate syntax 
- #Use curly braces around to surround the key. +# Use curly braces around to surround the key. 
- 42 ->table{"SomeKey"}+42 ->table{"SomeKey"}
    
 </code> </code>
4rpl/commands/settableelement.1610640981.txt.gz · Last modified: 2025/02/14 14:56 (external edit)