Re: Exit(n) vs. goto
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 17, 2002
- 484 views
Euler, I hope you don't mind me publishing your question in the Eu forum. 18/02/2002 2:15:28 PM, "Euler German" wrote: >would be possible to have as much identified loops as >we need? I mean, to handle situations when we could use a total, a mid >term and a simple (not identified) exit. Why not? I would not like to break any existing code so loop labels would have to be optional. Also, any loop could have a label. I suspect that the loop identifier should only be scoped to the containing routine (or file if its not in a routine). Though it might be argued that the scope should only be to the identifier loop and nested loops, similar to the automatic index variable in FOR loops. for i = 1 to width do:bAcross . . . for j = 1 to Height do:bDown . . . if a then exit bAcross end if . . . while c do:bAnalysis . . . if b then exit bDown end if if d then exit bAcross end if . . . end bAnalysis . . . end bDown . . . end bAcross -------- Derek