blob: c1df37db66e10b17c1af1f97bfb66609dbc1e1f0 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 string save_value(mixed value)
3 string save_value(mixed value, int format)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Encode the <value> into a string suitable for restoration with
7 restore_value() and return it.
MG Mud User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009 The optional <format> argument determines the format of the savefile
10 to be written:
MG Mud User88f12472016-06-24 23:31:02 +020011
Zesstra715ec202025-07-09 22:18:31 +020012 -1: use the driver's native format (default).
13 0: original format, used by Amylaar LPMud and LDMud <= 3.2.8 .
14 1: LDMud >= 3.2.9: no-lambda closures, symbols, quoted arrays
15 can be saved.
16 2: LDMUd >= 3.5.0: floats are stored in a different way, which is
17 more compact and can store the new floats losslessly.
18
19 It is recommended to use version 2 or higher.
20
21 The created string consists of two lines, each terminated with
22 a newline character: the first line describes the format used to
23 save the value in the '#x:y' notation; the second line is the
24 representation of the value itself.
25
26 The format of the encoded value and of the format line matches
27 the format used by save_object() and restore_object().
28
29HISTORY
30 Introduced in LDMud 3.2.8.
31 LDMud 3.2.9 added the saving of non-lambda closures, symbols,
32 and quoted arrays, using the new savefile format version 1.
33 LDMud 3.2.10 added the <format> argument.
34 LDMud 3.5.0 added savefile format version 2.
Zesstrad59c3892019-11-28 20:53:39 +010035
Zesstra715ec202025-07-09 22:18:31 +020036SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020037 restore_value(E), restore_object(E), save_object(E)