Jump to content
Sign in to follow this  
gtype

The for loop

Recommended Posts

gtype

Ok, so what i want to do is this. For example:

For $i = 0 to ($limit - 1)
    if not whatever Then
        somecrap
        $limit += 1
        ContinueLoop
    EndIf
Next

but i think that the $limit in the for loop only gets evaluated once. is it possible to make the for loop evaluate the expression at every pass? thank you

Share this post


Link to post
Share on other sites
ChrisL

You don't want a for loop

$iCnt = 0
While 1
    if not whatever Then
        somecrap
        $limit += 1
        ContinueLoop
    EndIf
    $iCnt +=1
    If $iCnt = $limit then ExitLoop
WEnd

Share this post


Link to post
Share on other sites
ChrisL

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×