setlocal
DESTINATION
,
FORMULA

The setlocal statement sets a value into a local variable. The name of the local variable is calculated on the fly.


Parameters

This statement has two parameters:

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

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


Description

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

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

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

local 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.