Re: goto's, and loops

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

EU>Hi all,

EU>Why is there no "goto" in Euphoria? It would be easy enough to implement,
EU>and if you don't want to use it, you don't haveto. I've used it sparingly in
EU>other languages, for the example below, for example. Maybe i am in a rut,
EU>but i don't see an nice way to do this example in Euphoria, can you help,
EU>please? ( Without making another procedure and all the vars global. )

EU>loop1
EU>some code
EU>loop2
EU>test var, maybe goto target
EU>-- an "exit" here would get you out of loop2, not loop1
EU>EndOfLoop1
EU>more code
EU>EndOfLoop2
EU>:target

EU>thanks,
EU>Kat
Gotos allow spagetti-code. It's much more elegant to use procedures and
functions, and it is also easier to debug.

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu