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/06/17 22:16] – justin | script_syntax [2023/02/13 23:09] – justin | ||
---|---|---|---|
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==== |