Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The ReadIni method  The SetTimer method Next page


The AddIni method is used to write, change and read integer variable from the ini file. The method returns the value of the variable after its changing.

Syntax for method invocation:

function AddIni(varName: String, varValue: int, path: String): int
  1. varName is a required argument. It specifies the name of the variable in the file.

  2. varValue is a required argument. It specifies the value of the variable or the value which must be added to the existing value of the variable:

    1. If a variable with the varName name and a string value is stored in the file, the varValue value will be assigned to the variable.
    2. If there is no variable with the varName name in the file, such a variable will be created and the varValue value will be assigned to it.
    3. If there is a variable with the varName name in the file and it has an integer value or its value can be brought to the integer type, the value will be brought to the integer type and the varValue value will be added to it.
  3. path is a required argument. It specifies the full path to the ini file in which the variable must be stored. Storage of variables can be placed on the network resource. To do this, enter the network path in the argument.

Example. There is no the MyVar variable in the C:\\test.ini file. Write to this file such a variable with the -1 value, then add 1 to it and display the result value in the script debug window.

var result = AddIni("MyVar", -1, "C:\\test.ini");

result = AddIni("MyVar", 1, "C:\\test.ini");

DebugLogString(result);
  • No labels