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 11:27] – [SetTableElement] Sanian4rpl:commands:settableelement [2021/03/05 10:07] (current) Karsten75
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 ======
Line 7: Line 13:
 ===== 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.1610641668.txt.gz · Last modified: 2021/01/14 11:27 by Sanian