User Tools

Site Tools


script_syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
script_syntax [2023/02/13 23:09] justinscript_syntax [2023/02/13 23:11] justin
Line 234: Line 234:
 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]]. 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.+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> <code bauxite>
 $items = codex["id": "ITEM_0001", "count": 5]; $items = codex["id": "ITEM_0001", "count": 5];
Line 241: Line 241:
 </code> </code>
  
-In the example below, a copy of $items is made using the "Duplicate" function. Since it's now a unique copy of the [[codex]], if the "count" key is changed to 10 for $items_copy, the original $items [[codex]] will remain unchanged.+In the example below, a copy of **$items** is made using the "Duplicate" function. Since it's now a unique copy of the [[codex]], if the "count" key is changed to 10 for **$items_copy**, the original **$items** [[codex]] will remain unchanged.
 <code bauxite> <code bauxite>
 $items = codex["id": "ITEM_0001", "count": 5]; $items = codex["id": "ITEM_0001", "count": 5];
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin