Microsoft KB Archive/89032

= Microsoft Knowledge Base =

FIX: DO WHILE Can't Be Used with Macro Substitution
Last reviewed: September 22, 1997

Article ID: Q89032

1.21 2.10 MS-DOS kbprg kbbuglist kbfixlist

The information in this article applies to:


 * Microsoft FoxBASE+ for MS-DOS, versions 1.21 and 2.1

SYMPTOMS
The DO WHILE command cannot be used with macro substitution. For example, the following code fragment causes an infinite loop:

STORE 1 TO x  STORE 'x' TO y   DO WHILE &y = 1 x=2 ENDDO

CAUSE
FoxBASE+ evaluates the loop condition only once, when execution encounters the DO WHILE statement. Changing the value of x inside the loop has no effect on the loop or exiting the loop, because the evaluation is not performed again.

STATUS
Microsoft has confirmed this to be a problem in FoxBASE+ versions 1.21 and 2.1 for MS-DOS. This problem was corrected in FoxPro version 2.5 for MS-DOS and FoxPro version 2.5 for Windows.