Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Instructions

Assigning Values to Variables

Scroll Prev Up Next More

To assign the value of an expression to a variable, follow the name of the variable by an equal sign and the expression whose value you wish to store into the variable.

bIsLeapYear = false
nYear = 1999
sMyName = 'Olivier'
nCount = nCount + 23
nToday = Today()
nDateEaster = GetEasterFor(nYear)
nWeekDay = WeekdayOf(Today())
nMayFirst = FirstDateOfMonth(YearOf(Today()),5)

Note that

 

The instruction x = y does not test if x equals y, and it does not define x as being equal to y. It tells the computer to make the value of x the same as the value of y, now.

The values of x and y may each be modified in subsequent instruction so that x is never equal to y again.

The equal sign here is not to be confused with the strict equality operator ==, which tests for equality.

 

See also: calling functions.

 


Topic 105129, last updated on 18-Apr-2020