blob: 2d20f86ec631090ec2761ab0e2109961a0073afe [file] [log] [blame]
Zesstrad59c3892019-11-28 20:53:39 +01001SYNOPSIS
2 mixed * m_values(mapping map)
3 mixed * m_values(mapping map, int index)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Returns an array with the values of mapping 'map'.
7 If <index> is given as a number between 0 and the width of
8 the mapping, the values from the given column are returned,
9 else the values of the first column.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011EXAMPLES
12 mapping m = ([ "foo":1;2;3, "bar":4;5;6, "baz":7;8;9 ])
13 m_values(m) --> returns ({ 1, 4, 7 }) or some permutation thereof
14 m_values(m, 0) --> returns ({ 1, 4, 7 }) (ditto)
15 m_values(m, 1) --> returns ({ 2, 8, 9 }) (ditto)
Zesstrad59c3892019-11-28 20:53:39 +010016
Zesstra715ec202025-07-09 22:18:31 +020017 Note that exact order of the values in the resulting arrays is not
18 specified, and may vary after any change to the mapping. The only
19 guarantee given is that if m_indices() and m_values() are taken at the
20 same time, the order of both results is identical.
Zesstrad59c3892019-11-28 20:53:39 +010021
Zesstra715ec202025-07-09 22:18:31 +020022SEE ALSO
23 mappingp(E), mkmapping(E), m_indices(E), m_add(E), m_delete(E),
24 sizeof(E), widthof(E), unmkmapping(E).