Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The Itv_var method  The GetIPAddress method Next page


The Int_var method sets and returns values of global variables of integer type.

Attention!

The Int_var method uses the same storage as the Itv_var method, but modifies the type of variable to the integer type.

Syntax for method invocation:

function Int_var (globalvar : String) : int
  1. Globalvar is a required argument. It specifies the name of the global variable. Possible values: String type that meets the requirements for valid names of String parameters of the Windows registry.

Note.

Global variables are stored in the system registry to maintain their values after Windows restart. All global variables are stored in the registry branch HKEY_USERS\S-1-5-21-…\Software\VMSScript\VMSSCRIPT and HKEY_CURRENT_USER\Software\VMSScript\VMSSCRIPT. To access a global variable directly from the registry, search the registry for it by its name.

Example. In the test example below, to check the method operation, the global variable named 2 is assigned a value of 1 that is then increases by 1 and is displayed in the debug window of the script. 

if(Event.Action =="RUN")
{
  Int_var(2) = 1;
  Int_var("2")++;
  DebugLogString(Int_var("2").toString());
}
  • No labels