Increments the value of a global integer variable. Global variables are accessible for all users on all agents.
Kernel.bdh
GlobalVarInc( in sVariable : string, in nInc : number, out nValue : number, in nTimeout : number optional ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
sVariable | Name of the global variable whose value is to be incremented. |
nInc | Number that is added to the value of the specified global variable. |
nValue | Variable receiving the value of the global variable after the increment operation. |
nTimeout |
Optional: Timeout for incrementing the value in seconds. If the specified time period is exceeded,
Silk Performer indicates an error.
The function’s default behavior is to wait until the increment operation is done. |
dcltrans transaction TInit begin if GetUserID() = 1 then GlobalVarSet("global counter", 1000); end; GlobalWaitFor("All", ALL_USERS); end TInit; transaction TMain var nCount: number; begin GlobalVarInc("global counter", 10, nCount); writeln(nCount); end TMain;