FOR...NEXT with 32767 or -32768 Index Fails to Stop Unless /d (37646)
This article was previously published under Q37646
SUMMARY
If you use an integer for a FOR...NEXT loop counter, and the top of
the loop is 32767 (when STEP is positive) or the bottom of the loop is
-32768 (when STEP is negative), an overflow error will be correctly
generated by QB.EXE or by the EXE compiled with /d. Without the /d,
the loop does not stop at the top/bottom; it wraps around and executes
indefinitely.
The problem occurs because overflow checking is only done when /d
compiler switch is specified.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB37646 |
|