This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:specialsyntax [2022/09/03 19:13] – Coerce table to list links Karsten75 | 4rpl:commands:specialsyntax [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 85: | Line 85: | ||
---- | ---- | ||
===== Lists ===== | ===== Lists ===== | ||
+ | |||
+ | < | ||
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 ===== | ||
+ | |||
+ | < | ||
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. | + | 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. |
=== Example === | === Example === | ||
Line 155: | Line 159: | ||
Table -> | Table -> | ||
- | # method | + | # method |
Do (GetTablecount(< | Do (GetTablecount(< | ||
Line 163: | Line 167: | ||
Loop | Loop | ||
- | # method | + | # method |
GetTableKeys(< | GetTableKeys(< |