Re: Anyone done anything with the Euphoria Source Code?

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

On 21 Jan 2002, at 1:20, mistertrik at hotmail.com wrote:

> 
> What about an 'exit' sort of proc, but one that can take a parameter..
> 
> eg...
> 
> function check(atom a, atom b, atom c)
>   return something
> end function
> 
> for x = 1 to 100 do
>   for y = 1 to 100 do
>       for z = 100 do
>         if check(x,y,z) then
>         exit(3) 

Ok, but if you go back and change the code, adding a loop, you now haveto 
remember this (3), and possibly change it too! I'd still rather have the clear 
label denoting the next execution block, and you can exit_to(blockname).

Kat

>       end for
>   end for
> end for
> 
> So it would get out of all loops if check returned positive. The only way to
> do
> that right now is put the loop in a proc, and call return, or use lots of
> boolean flags.... not fun. >guess i agree, but to be more versatile, lets have
> the "continue" >pecify >here to continue to, to get out of deeply nested
> loops,
> without lots >of >flow >control flag setting and testing,,, rather like this
> (and notice how >each >section is nicely blocked out with comment-like tags
> for
> the continue() >statement!) : > >procedure demo_continue() >for ... >--code
> 
> 
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu