The last section of any macro is the instructions block, whose purpose if to determine the values of sRESULT and bRESULT (and, optionally and rarely, nRESULT).
➢sRESULT initially contains an empty string, and bRESULT initially contains false. The compiler issues warnings or hints if either variable is not assigned a value. Assigning nRESULT is optional, and leaving it unassigned produces no corresponding compiler message.
The instructions block begins with the begin keyword and ends with the end keyword, and is where most of the work of the macro happens.
var
begin
// bResult will be true if the date of the token is a Sunday
bResult = (WeekdayOf(n_TokenDate) == 7)
// replace the macro token by the token without the *XX
sResult = '[' + IntToStr(n_TokenDayValue) + s_TokenRoot + ']'
end
See also: the code structure of a macro.
Topic 133500, last updated on 08-Oct-2026