Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ucsbcsl.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxlm!akgua!sdcsvax!sdcrdcf!trwrb!trwrba!cepu!ucsbcsl!forrest
From: forrest@ucsbcsl.UUCP ( )
Newsgroups: net.micro.pc
Subject: A bug in dBase III
Message-ID: <232@ucsbcsl.UUCP>
Date: Mon, 4-Feb-85 12:50:09 EST
Article-I.D.: ucsbcsl.232
Posted: Mon Feb  4 12:50:09 1985
Date-Received: Fri, 8-Feb-85 03:43:04 EST
Organization: U.C. Santa Barbara
Lines: 39

The following is a minor but annoying bug I found in dBase III. The
line numbers are for reference, they are not part of the files in
question.

1	DO WHILE .T.
2		INPUT 'Enter task ' TO TASK
3		OK = .T.
4		DO WHILE OK
5			OK = .F.
6			DO CASE
7				CASE TASK = 3
8				DO C:TEST
9			ENDCASE
10		ENDDO
11	ENDDO

1	* THIS IS THE TEST PROGRAM CALLED IN LINE 8 ABOVE
2	? 'IN TEST'
3	DO WHILE .T.
4		? 'IN WHILE'
5		RETURN
6	ENDDO

What happens is that after TEST returns pack to the calling program,
the calling program resumes at line 5 and not line 4. In other words,
even though OK has been set to .F., which would stop the WHILE loop at
line 4, line 4 is not executed. What you get is an infinate loop.
I believe the problem is caused by the RETURN in line 5. If I take it out
the program works as expected. There is no mention in any dBase
documentation that you shouldn't exit WHILE loops with a RETURN
statement.

I should mention that the programs shown are fragements of larger
programs and should not be taken as being inherently meaningful.

Also, I volunteer to serve as a central bug report library for
dBase III, if there is a need. If you send me anything, please
include your company namem and real phone number. I have problems
figuring out how to reply to people's mail on this crazy net.