User Tools

Site Tools



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

Link to this comparison view

harlowe:datavalues [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(datavalues:​ // [[harlowe:​Datamap|datamap]]//​) -> //​[[harlowe:​Array|array]]//​**
 +This takes a [[harlowe:​datamap|datamap]],​ and returns an [[harlowe:​array|array]] of its values, sorted
 +alphabetically by their name.
 +=== Example usage: ===
 +''​%%(datavalues:​ (dm:'​B',​24,​ '​A',​25))%%''​ produces the array ''​%%(a:​ 25,​24)%%''​
 +=== Rationale: ===
 +Sometimes, you may wish to examine the values stored in a datamap without
 +referencing every name - for instance, determining if 0 is one of the values.
 +(This can't be determined using the ''​%%contains%%''​ keyword, because that only checks
 +the map's data names.) You can extract all of the datamap'​s values into an array
 +to compare and analyse them using (datavalues:​). The values will be sorted by
 +their associated names.
 +=== See also: ===
 +[[harlowe:​datanames|(datanames:​)]],​ [[harlowe:​dataentries|(dataentries:​)]]
harlowe/datavalues.txt ยท Last modified: 2017/10/09 20:39 (external edit)