variable save
This function saves the contents of a variable into a JSON file. If the file is already existin, then the contents will be replaced (and not appended).
Since JSON does not support intermediate nodes in the data trees, but B4P variables do, the base variables at all levels will be put into
intermediate arrays containing 2 elements. Element 0 contains the value of the base variable, and Element 1 contains further data up the data tree.
Indirect parameter passing is disabled
2, 3
No. | Type | Description |
---|---|---|
1, etc. code |
variable :string |
Source variable name The contents will be loaded into this variable. |
2 input |
string | File name This file will be created. |
Opt. 3 input |
string | JSON Format Following values are supported:
JSON: Save JSON in nice format with every item in a separate line and text indentation used |
b[Green] = Grün;
b[Blue] = Blau;
b[Blue,light] = Hellblau;
b[Blue,dark] = Dunkelblau;
variable save( b[], "Outputs/colors.json");
variable load( c[], "Outputs/colors.json", JSON B4P );
see( c[] );
c[] [Void] (void,full access)
Blue Blau (quoted string,full access)
dark Dunkelblau (quoted string,full access)
light Hellblau (quoted string,full access)
Green Grün (quoted string,full access)