The Itv_var method sets and returns the values of global variables.
Syntax for method invocation:
function Itv_var (globalvar : String) : String |
Global variables are stored in the Windows 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. On macro 1, save the value of the bright parameter of camera 10 to the cam10bright global variable. On macro 2, set the bright parameter of the cameras 1 to 4 to the value of the cam10bright global variable.
if (Event.SourceType == "MACRO" && Event.Action == "RUN") { if(Event.SourceId == "1") { Itv_var("cam10bright") = GetObjectParam("CAM", "10", "bright"); } if (Event.SourceId == "2") { var cam10bright = Itv_var("cam10bright"); for(i=1; i<=4; i=i+1) { SetObjectParam("CAM", i, "bright", cam10bright); } } } |