Variable is declared but never used

Navigation:  Macros > Macro Language > Compiler Messages > Hints >

Variable is declared but never used

Previous pageReturn to chapter overviewNext page

This macro compiler hint occurs if you declare a variable but never use it anywhere in the macro.

 

This hint can be the sign of a simple oversight, a variable you meant to use but finally did not need, as is the case in the example below.

var
   nNewDate // variable is never used
begin
   if WeekdayOf(n_TokenDate) <> 7
      sRESULT = 'Monday to Saturday'
   else
      sRESULT = 'Sunday'
   endif
end

However this hint can also indicate that there are loose ends in your macro. For example you started to add a feature to your macro, added a variable and then were distracted and forgot to write the code that was meant to use this variable.


Topic 115110 updated on 24-Feb-2019.
Topic URL: https://www.qppstudio.net/webhelp_xv4/index.html?variableisdeclaredbutneverused.htm