Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Compiler Messages > Hints

bRESULT is never used in this Macro

Scroll Prev Up Next More

This macro compiler hint occurs if you never assign a value to a bRESULT within a macro.

var
begin
   if IsWeekend(n_TokenDate)
      sRESULT = 'weekend'
   else
      sRESULT = 'weekday'
   endif
end

This omission may not be a problem if you are not trying to modify the text or textbox attributes as a result of this macro, hence the value of bRESULT is irrelevant.

 

When you do not set a value to bRESULT, it will keep it initial value: false.

 

So the above example is equivalent to the following:

var
begin
   bRESULT = false // more clear
   if IsWeekend(n_TokenDate)
      sRESULT = 'weekend'
   else
      sRESULT = 'weekday'
   endif
end

To avoid this hint, and to clearly indicate that you know that bRESULT should be false, you should get in the habit of specifically setting the value of bRESULT to false, even if you do not plan on using that variable.

 


Topic 108288, last updated on 19-Apr-2020