Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Compiler Messages > Warnings

The value of bRESULT may be, or is, undefined at the end of the Macro

Scroll Prev Up Next More

This compiler warning is generated if it is possible for the value of bRESULT to be undefined at the end of a macro.

 

In the example below, bResult is undefined if the function HolidayOfListOnDate returns false.

var
begin
    if HolidayOfListOnDate('a', n_TokenDate)
        bRESULT = true
    endif
end

Usually this type of warning occurs using branching without specifying what happens in the else case.

 

There are 2 way to address this warning, using the above example:

var
begin
   bRESULT = false
   if HolidayOfListOnDate('a', n_TokenDate)
       bRESULT = true
   endif
end

or alternatively, and more simply:

var
begin
   bRESULT = HolidayOfListOnDate('a', n_TokenDate)
end

Note that you should also include an else statement in switch statements.

 


Topic 110124, last updated on 18-Apr-2020