Re: Replacing GOTO. [was Re: Conceptual problem solved by GOTO]
- Posted by Fernando Bauer <fmbauer at ?otmai?.com> Jun 08, 2008
- 748 views
CChris wrote: [snipped] > > Maybe it's still possible to extend the use of labels to 'if-then-else' > > construct. > > I read somewhere this kind of syntax: > > for i = 1 to length(s) label "xyz" do > > > > For now, by analogy and for completeness, maybe we could have this: > > if ..cond.. label "xyz" then > > > > Regards, > > Fernando > > It is implemented in v4.0 already. > > if-blocks can have labels too, and "break" breaks out of them. > > CChris Using labels (ex. break "xyz"), why add another keyword ("break") when "exit", which IMHO has the same meaning, could be used instead? Without using labels, ok, "break" could be used to distinguish an exit from a if-then-else construct from an exit from a loop, but is this a sufficient reason to add it? Regards, Fernando