putvar (string FileName, string VarName, var Value)
getvar (string FileName, string VarName): var
Writes, updates, or reads a variable to or from a file or the Windows registry. Can be used for storing data globally or exchanging data between different scripts or Zorro instances.
||Name of the file. If it does not exist, it is created. If
0, the variable is stored in the Windows registry.
||Name of the variable.
||Value to be written or updated.
Current variable value (getvar).
If the variable does not yet exist, 0 is returned.
- If several Zorro instances access the same variable at the same time, it should be locked between reading and writing.
- The variables are stored in a normal text file that can be viewed with a text editor or spreadsheet program.
But it must not be manually edited or modified unless it is ensured
that the file size does not change. Any variable
in the file has a fixed line length for speedier access.
function increase_global_counter(string Name)
string FileName = "\\Log\\Counters.csv";
int Counter = getvar(FileName,Name);
file, strvar, lock