User Tools

Site Tools


4rpl:commands:specialsyntax

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:specialsyntax [2022/09/03 19:13] – Coerce table to list links Karsten754rpl:commands:specialsyntax [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 85: Line 85:
 ---- ----
 ===== Lists ===== ===== Lists =====
 +
 +<=[[4rpl:start#lists| List Commands]] \\
  
 Lists are collections of data. They are similar to arrays but they do not have a fixed length.  Lists are collections of data. They are similar to arrays but they do not have a fixed length. 
Line 117: Line 119:
 ---- ----
 ===== Tables ===== ===== Tables =====
 +
 +<=[[4rpl:start#Tables| Table Commands]] \\
  
 Tables are collection of named data. They are sometimes called dictionaries in other languages.  Tables are collection of named data. They are sometimes called dictionaries in other languages. 
Line 144: Line 148:
  
 ==== Coerce table to list  ==== ==== Coerce table to list  ====
-It is possible to iterate over the elements in a table by coercing the table into a list. The following shows two equivalent methods to extract data from a table. The last of the two is slightly more efficient. +It is possible to iterate over the elements in a table by coercing the table into a list. The following shows two equivalent methods to extract data from a table. Method Two is slightly more efficient. 
  
 === Example === === Example ===
Line 155: Line 159:
 Table ->units  Table ->units 
  
-# method 1+# method One
   
 Do (GetTablecount(<-units) 0) Do (GetTablecount(<-units) 0)
Line 163: Line 167:
 Loop Loop
  
-# method 2+# method Two
  
 GetTableKeys(<-units)->keys GetTableKeys(<-units)->keys
4rpl/commands/specialsyntax.1662232429.txt.gz · Last modified: 2025/02/14 14:56 (external edit)