Difference between revisions of "Script To Work With Global Variables"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
 
Line 8: Line 8:
  
 
Remove a global variable
 
Remove a global variable
  actions.removeEventGlobal(String key){
+
  actions.removeEventGlobal(String key)
 +
 
 +
Example script function will output the existing global if available, otherwise c:\temp\vpcfolder99
 +
log.warn(actions.getEventGlobal("vpcfolder","c:\temp\vpcfolder99"));

Latest revision as of 10:15, 5 May 2022

Global variables in the event scripting engine allow you to share variables across systems

Get a global, if not available use the default provided and add save that for future use.

actions.getEventGlobal(String key,String adefault)

Create a global variable (this will overwrite any existing value)

actions.setEventGlobal(String key,String value)

Remove a global variable

actions.removeEventGlobal(String key)

Example script function will output the existing global if available, otherwise c:\temp\vpcfolder99

log.warn(actions.getEventGlobal("vpcfolder","c:\temp\vpcfolder99"));