Re: Anyone done anything with the Euphoria Source Code?

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

On 19 Jan 2002, at 0:06, tone.skoda at siol.net wrote:

<snip>

> It keeps your code more organized. gotos are not needed. Maybe "continue"
> statement.

I guess i agree, but to be more versatile, lets have the "continue" specify 
where 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
  while ...
--code
    if...
--code
      for...
--code
        if (we are finally done here) then 
          continue(coreprocessing)
        end if
--code
     end for
--code
    end if
--code
        if (we are finally done here) then 
          continue(coreprocessing)
        end if
  end while
--code
end for


:coreprocessing -- nice clear label !
-- more code
while whatever
--code
if .....then continue(wrapup)
--code
end while

:wrapup -- another clear definative label !
--code

end procedure

Kat  blink

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

Search



Quick Links

User menu

Not signed in.

Misc Menu