Re: Replacing GOTO. [was Re: Conceptual problem solved by GOTO]

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu