V6-not-optim, V6-Debug, and V6-optimised give not the same nested FOR-NEXT execution

Discussion in 'Questions (Windows Mobile)' started by dan kabestan, Jan 4, 2008.

  1. dan kabestan

    dan kabestan Member Licensed User

    Pasting a current job from V580 to V6 i found a new infinite loop.
    Searching a solution i found two different results in nested FOR-NEXT loop execution.
    Between Debug mode or normal compilation and, the Optimised compilation.
    This last forbids (or dont take care, the same thing) to modify a for-next-loop variable inside the loop !
    That is new, its more strong severity than Ada.

    Would you see the next script :
    'listbox1 declared
    Sub test
    For n =1 To 6
    For p = 1 To 5
    listbox1.Add("____n=" & n & " p=" & p)
    If p = 2 Then : p=4 : listbox1.Add(" p=2 change_to p=4 ") : End If
    If n = p Then : listbox1.Add(n & " [n = p decide_to EXIT_n]") : Exit : End If
    End Sub
    And the joint result files.

    So, as you want, but it could be great that the help inside b4ppc be update with the release and
    the DEBUG run same as the Super fast & Extra-compacted-code Optimised_Compiler....
    thanks for help.

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    It is a bug.
    It will be fixed in the next update.

    A workaround for now is to use a global variable as the for-next index.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice