IB For/Next bug (I think)


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Bob Pride on March 03, 2008 at 15:59:47:

I have a program construct that looks like this:

SUB:
FOR X = 1 TO 99
FILENAME$ = "FILE" + STR(X)
CLOSE (1) FILENAME$ & OPEN (1) FILENAME$, EXCP = NOFILE

NEXTX:
NEXT X
RETURN

NOFILE:
IF EXCP NE 11 ERROR
GOTO NEXTX

Well, when I run this code, it loops forever. Using the F3 key to pause, I can see it iterates from 1 to 99 and starts over again. There is no file after FILE80, so it successfully goes to NOFILE 19 times and the counter stays on track. Apparently, after breaking for the error on iteration 99, IB forgets the counter ends at 99 and starts over with 1. Thsi is an old program that was converted to Comet with the only changes being the source/use file names and the few programming conventions that are differnt (IND vs. KEY for example.)

I put in a work around (IF X = 99 RETURN in the error handling lines); but wanted to report the possible bug.

Bob




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]