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

Navigation:  Messages > Macro Compiler Messages > Warnings >

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

Previous pageReturn to chapter overviewNext page

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 updated on 11-Apr-2002.
Topic URL: http://www.qppstudio.net/webhelp/index.html?thevalueofbresultmaybe_oris_un.htm