I have not used the Continue or Break control structure very often, probably 
because I was taught that methods, functions, loops, etc should have one exit 
(whenever possible). That is kind of like the "Third Normal form" in relational 
theory - nice idea but sometimes not practical.

The other reason is that I seem to have periodic problem with it in for each 
loops. I can't pin down the exact circumstances but something like:

        $c := new collection("one";1;"two";2;"three";3;"four";4)
        for each ($c; $key; $value)
                if ($value = 3)
                        continue
                end if
                writebr('$key $value')
        end for each

will SOMETIMES generate a syntax error

continueend if
Syntax error.

Continue is on a line by itself but the parser seems to miss that. The instance 
I'm dealing with is in a private library method called from a loop in a library 
method. I've tried to simulate that with the above test code, but it works 
fine. Unfortunately I had to resort to some deeply nested if statements.

Just wondering if anyone else has encountered this and know what the 
circumstances are. This is active4d 4.5.

Steve
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to