This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
script_syntax [2022/05/17 22:15] – justin | script_syntax [2023/02/13 23:11] – justin | ||
---|---|---|---|
Line 116: | Line 116: | ||
^Type^Examples^ | ^Type^Examples^ | ||
|[[String]]|" | |[[String]]|" | ||
- | |[[Decimal]]|17, 3.14159| | + | |[[Number]]|17, 3.14159| |
|[[Boolean]]|true, | |[[Boolean]]|true, | ||
|[[Coordinate]]|coord[1, | |[[Coordinate]]|coord[1, | ||
Line 230: | Line 230: | ||
</ | </ | ||
List of integers from 5 to, but not including, 0, with an increment of -1 (i.e. 5, 4, 3, 2, 1). | List of integers from 5 to, but not including, 0, with an increment of -1 (i.e. 5, 4, 3, 2, 1). | ||
+ | |||
+ | ====Duplicate==== | ||
+ | The **duplicate** function creates a unique copy of an [[array]] or [[codex]]. Since the copy is unique, you can modify its data without affecting the original [[array]] or [[codex]]. | ||
+ | |||
+ | Using the code below, **$items_copy** will contain a reference to the original **$items** [[codex]], so any changes to one will affect the other. | ||
+ | <code bauxite> | ||
+ | $items = codex[" | ||
+ | $items_copy = $items; | ||
+ | $items_copy[" | ||
+ | </ | ||
+ | |||
+ | In the example below, a copy of **$items** is made using the " | ||
+ | <code bauxite> | ||
+ | $items = codex[" | ||
+ | $items_copy = duplicate($item_data); | ||
+ | $items_copy[" | ||
+ | </ | ||
====Inverse==== | ====Inverse==== |