BUG: Do Until Loop Evaluates "True" as -1 ExclusivelyLast reviewed: November 12, 1997Article ID: Q176641 |
The information in this article applies to:
SYMPTOMSA Do Until loop that uses a literal or a variable of type Integer as a conditional will execute endlessly if the value is not -1.
RESOLUTIONUse a variable of type Variant or Long as the conditional argument for the loop.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONVisual Basic defines "True" to mean "non-zero." Any value that is not zero should be evaluated as True. The Do Until loop in Visual Basic 5.0, however, evaluates only -1 as True if a literal value or a variable of type integer is used for the conditional argument.
Steps to Reproduce BehaviorMethod 1:
|
Additional query words: infinite loop iterate
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |