beautypg.com

Visara Master Console Center Scripting Guide User Manual

Page 180

background image

Chapter 5 Script Commands

Scripting Guide

180

Examples:

Simple Script to log all of the script information to the filtered message
log:

%rc := SCRIPTGETACTIVE($AssocArray)

IF %rc == 0%
Num := ALEN($AssocArray) // Get the number of scripts
ASSOCKEYS( $AssocArray, $NormalArray) // Put into a normal
array
%Index := 1
WHILE %Index <= %Num // Log individual script info
$Seq := $NormalArray[%Index]
$AlertInfo := $AssocArray[$Seq]
LOG(LOG_FLT, "Script info is " + $AlertInfo)
INC %Index
ENDWHILE
ENDIF

Simple Script to break down all of the component parts of the returned
script array and log everything to the filtered message log:

%rc := SCRIPTGETACTIVE( $Array )
LOG( LOG_FLT, "There are currently " + ALEN($Array) + \"
active scripts." , 5)
ASSOCKEYS( $Array, $NormalArray) // Put into a normal array
%ArrayIndex := 1

WHILE (%ArrayIndex <= ALEN($Array))
SPLIT($ScriptInfo, $Array[$NormalArray(%ArrayIndex)], " ")
LOG(LOG_FLT, "Script #: " + STR(%ArrayIndex), 1)
LOG(LOG_FLT, $ScriptInfo[1] + " : " + $ScriptInfo[2], 5)
LOG(LOG_FLT, $ScriptInfo[3] + " : " + $ScriptInfo[4], 5)
LOG(LOG_FLT, $ScriptInfo[5] + " : " + $ScriptInfo[6], 5)
LOG(LOG_FLT, $ScriptInfo[7] + " : " + $ScriptInfo[8], 5)
LOG(LOG_FLT, $ScriptInfo[9] + " : " + $ScriptInfo[10], 5)
LOG(LOG_FLT, $ScriptInfo[11] + " : " + $ScriptInfo[12], 5)
LOG(LOG_FLT, $ScriptInfo[13] + " : " + $ScriptInfo[14], 5)
LOG(LOG_FLT, $ScriptInfo[15], 5 )
LOG(LOG_FLT, "------------------------------------------",
1)
INC %ArrayIndex

ENDWHILE
RETURN

See Also:

Executing Scripts