have you tried LOOP WHILE READNEXT ID DO ?

MAJ Programming wrote:
LOOP WHILE READNEXT does not work on D3.
Mark Johnson
----- Original Message ----- From: "Keith Johnson [DATACOM]" <kei...@datacom.co.nz>
To: <u2-users@listserver.u2ug.org>
Sent: Monday, March 02, 2009 7:38 PM
Subject: Re: [U2] DO/WHILE vs IF THEN


Mark Johnson suggested the following change

<Before>
GOOD.ANS=FALSE
LOOP UNTIL GOOD.ANS DO
  PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
  IF ANS="Y" OR ANS="N" THEN GOOD.ANS=TRUE REPEAT

<after>
LOOP WHILE TRUE DO
  PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
  IF ANS="Y" OR ANS="N" THEN EXIT
REPEAT
These forms all work (Universe 10.2.0)  and are progressively shorter
than the above

LOOP
   PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
   IF ANS="Y" OR ANS="N" THEN EXIT
REPEAT


LOOP
   PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
UNTIL ANS="Y" OR ANS="N" DO
REPEAT


LOOP
   PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
UNTIL ANS="Y" OR ANS="N" REPEAT


LOOP PRINT "ENTER 'Y' OR 'N' ":;INPUT ANS
UNTIL ANS="Y" OR ANS="N" REPEAT


Ray Wurlod was a great proponent of the LOOP WHILE READNEXT ID format.
I believe it may not compile on some MV systems.


Regards, Keith
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to