setglobal
DESTINATION
,
FORMULA

The setglobal statement sets a value into a global variable. The name of the global variable is calculated on the fly.


Parameters

This statement has two parameters:

destination – is a formula that calculates the name of the global variable that you want to modify.

formula – calculates the value that will be placed into the destination global variable.


Description

This statement sets a value into a global variable. The name of the global variable is calculated on the fly.

setglobal datepattern( today(),"DayOfWeek"),DepartureTime

Here is the same procedure rewritten without using the setglobal statement. This illustrates the power of the setglobal statement, which in this case is doing the same work as 17 statements.

global Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
local dayName
dayName=datepattern( today(),"DayOfWeek")
case dayName="Sunday"
     Sunday=DepartureTime
case dayName="Monday"
     Monday=DepartureTime
case dayName="Tuesday"
     Tuesday=DepartureTime
case dayName="Wednesday"
     Wednesday=DepartureTime
case dayName="Thursday"
    Thursday=DepartureTime
case dayName="Friday"
    Friday=DepartureTime
case dayName="Saturday"
    Saturday=DepartureTime
endcase

See Also


History

VersionStatusNotes
10.0NewNew in this version.