Re: goto's, and loops
- Posted by Irv Mullins <irv at ELLIJAY.COM> Jul 29, 1999
- 550 views
On Thu, 29 Jul 1999, you wrote: > Hi all, > > Why is there no "goto" in Euphoria? It would be easy enough to implement, > and if you don't want to use it, you don't haveto. I've used it sparingly in > other languages, for the example below, for example. Maybe i am in a rut, > but i don't see an nice way to do this example in Euphoria, can you help, > please? ( Without making another procedure and all the vars global. ) Let's see what you've written: > loop1-------------- > something | > loop2 -------------|--------- > test var, maybe goto | | > -- an "exit" | | > EndOfLoop1---------- | > more code | > EndOfLoop2------------------ > :target Follow the lines. That's why 1. you don't see gotos' in all languages, and 2. you get a D on the assignment, unless you can find a real life example where this construct works under all test conditions, and cannot be replaced with simpler, properly nested code.. Irv