blob: c129e3f1f00df1e72b8cad205ea7c13f8e357032 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 mapping m_reallocate(mapping m, int width)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
5 Create a new mapping with <width> values per key and fill it
6 with the values from mapping <m>. If <m> has less than <width>
7 values per key, the extra values in the result are set to 0.
8 If <m> has more values per key, the extra values are ignored.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra715ec202025-07-09 22:18:31 +020010 The mapping <m> is not changed.
MG Mud User88f12472016-06-24 23:31:02 +020011
Zesstra715ec202025-07-09 22:18:31 +020012EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020013 mapping m = ([ "foo":1;2;3, "bar":4;5;6 ])
14
Zesstra715ec202025-07-09 22:18:31 +020015 m_reallocate(m, 1) --> returns ([ "foo":1, "bar:4 ])
16 m_reallocate(m, 4) --> returns ([ "foo":1;2;3;0, "bar:4;5;6;0 ])
MG Mud User88f12472016-06-24 23:31:02 +020017
Zesstra715ec202025-07-09 22:18:31 +020018HISTORY
19 Introduced in LDMud 3.2.6, suggested by Tubmud.
MG Mud User88f12472016-06-24 23:31:02 +020020
Zesstra715ec202025-07-09 22:18:31 +020021SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020022 m_allocate(E), m_values(E), widthof(E)