Re: Well I did it! (variable_id, etc..)

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

I think I've got it figured out (I think...) To stick with current
keyword conventions, this is how next will operate:

    -- example 1:
    for i = 1 to 5 do
        if i = 4 then
            next    -- should skip 4
        end if
    end for

    -- example 2:
    while 1 do
        if some_condition then
            next -- skip the rest of the code
        end if
        -- do something else
    end while

This way next operates just like exit, except it goes to the top of
the loop, not the bottom. Give me a few days to get it worked out,
there's still a few parts of the interpreter I don't understand, which
is preventing me from getting everything working.

~Greg


On Fri, 26 Nov 2004 09:54:40 +0000, Pete Lomax
<petelomax at blueyonder.co.uk> wrote:
> 
> On Thu, 25 Nov 2004 22:09:37 -0500, Greg Haberek <ghaberek at gmail.com>
> 
> 
> wrote:
> 
> >
> >> Looks pretty intuitive to me!
> >
> >Um... kinda. In my opinion, the next statement should act like an exit
> >statement, only instead of leaving the loop, it jumps back to the top
> >and increments the counter when needed (for vs while). The problem is,
> >I don't know if I'm in a for or a while loop. I wish I could explain
> >it better, you'd understand if you've studied the source code as much
> >as I have in the past few days... What you're offering would be nice
> >to have, but it looks like it could get a bit messy (internally, that
> >is).
> >
> I was about to say that
>        next a  -- for loop
> might get confused with
>        next            -- while loop
>        a = ...
> 
> I don't know if this will help or not but you may have slightly more
> luck with next(a) since no valid euphoria statement begins with (
> 
> Pete
> 
> 
> 
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu