Input value is ignored

Navigation:  Messages > Macro Compiler Messages > Warnings >

Input value is ignored

Previous pageReturn to chapter overviewNext page

This macro compiler warning occurs if you declare a variable in the input section of a macro, but then assign a value to it in the body of the macro, before the input value is ever used.






   nNewDate = n_TokenDate + 5 // any input value is ignored !!

  if WeekdayOf(nNewDate) <> 7

       sRESULT = 'Monday to Saturday'


       sRESULT = 'Sunday'




This message is classified as a warning, even though it is fundamentally similar to the message that the value assigned to a variable is never used, which is only a hint. The reason is that the present message usually comes from modifying a macro that did not use input values to a macro that uses input values, and forgetting to remove the initialization of the variable that has become an input variable. These are extremely hard errors to find because you are so used to seeing the initialization code (line nNewDate = n_TokenDate + 5 in this case) that when your macro does not give the expected results, you search everywhere else but in that line, for the cause of the problem.

Topic 109904 updated on 04-Nov-2002.
Topic URL: