Loop condition must be a Boolean expression

Navigation:  Messages > Macro Compiler Messages > Errors >

Loop condition must be a Boolean expression

Previous pageReturn to chapter overviewNext page

This compiler error will occur if the expression that follows a while reserved word is not a boolean expression. The examples below would cause this error to occur :

 

while n_TokenDate // integer !!!

endwhile

 

while EvalToken(n_TokenDate, 'm') // string !!!

endwhile

 

Note, however, that what follows the reserved word while can be a complex expression, as long as its result is boolean.

 

nCurDate = n_TokenDate

while EvalToken(nCurDate,'[m]') == '1'

  inc(nCurDate)

endwhile

 

In the above example, the loop runs until the evaluation of the token [m] on that date no longer translates into the string '1' (ie. it is no longer in January).


Topic 109016 updated on 11-Apr-2002.
Topic URL: http://www.qppstudio.net/webhelp/index.html?loopconditionmustbeabooleanexp.htm