I agree I'm not a fan of EXIT, I think it's bad style.
But I also don't like for....untils
I would code
A1 = 0
LOOP UNTIL (G=H) OR (A1=X) DO
A1 += 1; A2 = 0
LOOP UNTIL (G=H) OR (A2=Y) DO
A2 += 1
You're in a maze of twisty little passages all alike
REPEAT
REPEAT
Must be my PASCAL background.
No wire hangers!!!! I mean no gotos, no exits, no return tos... modular,
relocatable logic only
-----Original Message-----
From: Boydell, Stuart <[email protected]>
To: U2 Users List <[email protected]>
Sent: Thu, Apr 19, 2012 2:00 pm
Subject: Re: [U2] EXIT ; EXIT inside a loop
It would work, until someone moved the twisted logic into a gosub. Personally,
'm not a fan of exits, I think they can get buried. I would use the
while|until] clause instead and build the logic betwixt accordingly:
or A1 = 1 to X until G = H
or A2 = 1 to Y until G = H
retwisted logic (agh)>
ext A1
ext A2
Stuart
_______________________________
rom: Dave Laansma
ent: 20-Apr-12 6:36
o: [email protected]
ubject: [U2] EXIT ; EXIT inside a loop
Given:
FOR A1 = 1 TO X
FOR A2 = 1 TO Y
<little twisted logic>
IF G = H THEN EXIT ; EXIT
<twisted little logic>
NEXT A2
<twisting little logic>
NEXT A1
<little twisting logic>
The question is, if G = H, will the two EXIT commands drop out of both
oops, skipping BOTH <twisted little logic> and <twisting little logic>,
nd resume execution at <little twisting logic> ?
PLOUGH
Sincerely,
David Laansma
IT Manager
Hubbard Supply Co.
Direct: 810-342-7143
Office: 810-234-8681
Fax: 810-234-6142
www.hubbardsupply.com<http://www.hubbardsupply.com>
<http://www.hubbardsupply.com>
"Delivering Products, Services and Innovative Solutions"
_______________________________________________
2-Users mailing list
[email protected]
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
2-Users mailing list
[email protected]
ttp://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users