Difference between revisions of "Script To Work With Global Variables"
From Observer GigaFlow Support | VIAVI Solutions Inc.
Kevin Wilkie (Talk | contribs) (Created page with "Get a global, if not available use the default provided actions.getEventGlobal(String key,String adefault) Create a global variable (this will overwrite any existing value) ...") |
Kevin Wilkie (Talk | contribs) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | Get a global, if not available use the default provided | + | 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) | actions.getEventGlobal(String key,String adefault) | ||
Line 6: | 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"));