That of course would most likely not compile on our UniData system, since unlike D3 it's case sensitive and I don't think it supports lower case Basic code. And if there is even a remote chance the code might be ported to D3 one day and you write it in upper case, you are right of course. But what about '3 more keystrokes and an extra line of code?' to answer your question. Up to now I actually thought the "DO" was required syntax and not just a throw-away, so from now on I'm going to save another 3 keystrokes :-) Scott Ballinger wrote:
Why not something simple that works everywhere, like loop readnext id else exit ... repeat /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 On Mon, Mar 30, 2009 at 12:01 AM, Mecki Foerthmann <[email protected]> wrote: 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]" < [email protected]> To: <[email protected]> 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 [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
