Script Object (default)

The object is supplied for the exclusive use of a script instance.

Creation Method: System-provided object

Reference Name: @script

Scope: Script instance (created by the script interpreter for the script instance, and destroyed when the script terminates)

Script object methods:

exec

execute (deprecated)

formatDate

formatDateValue

generateUUID

getGlobalConstant

getResourceURL

getSystemProperty

getTimeAsLong

log

setLog

General examples

The following example illustrates how to use the script object to store various kinds of temporary data and information that will exist only for the execution of the script:

$script.subtotal = 14

 

$script.taxes = 2.32

 

# Return whether the log was created

$createdLog = @script::setLog("Accounting.log")

 

# Indicate in the log file whether log was created for the first time

IF ($createdLog)

@script::log("Log File Created")

ENDIF

 

$script.total = $script.subtotal + $script.taxes

@script::log("The total is:")

@script::log($script.total)

 

#short hand notation variable access for script object

#automatically assumes $script based variable

$counter = $counter + 1