User Tools

Site Tools



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

Link to this comparison view

harlowe:datanames [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(datanames:​ // [[harlowe:​Datamap|datamap]]//​) -> //​[[harlowe:​Array|array]]//​**
 +This takes a [[harlowe:​datamap|datamap]],​ and returns a sorted [[harlowe:​array|array]] of its data names, sorted
 +=== Example usage: ===
 +''​%%(datanames:​ (dm:'​B','​Y',​ '​A','​X'​))%%''​ produces the array ''​%%(a:​ '​A','​B'​)%%''​
 +=== Rationale: ===
 +Sometimes, you may wish to obtain some information about a datamap. You may want
 +to list all of its data names, or determine how many entries it has. You can use
 +the (datanames:​) macro to do these things: if you give it a datamap, it produces
 +a sorted array of all of its names. You can then [[harlowe:​print|(print:​)]] them, check the length
 +of the array, obtain a subarray, and other things you can do to arrays.
 +=== See also: ===
 +[[harlowe:​datavalues|(datavalues:​)]],​ [[harlowe:​dataentries|(dataentries:​)]]
harlowe/datanames.txt ยท Last modified: 2017/10/09 20:39 (external edit)