"FOR without a matching NEXT" even though there is a next for it.


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102

    Default "FOR without a matching NEXT" even though there is a next for it.

    Dear readers,
    I wrote the following
    Code:
        for counter_outside = 1 to ((Y_top - Y_below)/steps)
            for counter = 1 to ((X_right - X_left))
                if right_left = 1 then
                    GOSUB Turn_left
                    right_left = 0
                else
                    GOSUB Turn_right
                    right_left = 1
                endIF
                Pause 20
            NEXT counter
            
            for counter = 1 to steps
                if top_below = 0 then
                    GOSUB Turn_below
                else
                    GOSUB Turn_top
                end
                Pause 20
            NEXT counter
            
        NEXT counter_outside
    and microcode studio says "FOR without a matching NEXT." and marks counter_outside. What is wrong ?
    Be well - whoever you are.

  2. #2
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    I found it.

    Code:
                else
                    GOSUB Turn_top
                end
    should be
    Code:
                else
                    GOSUB Turn_top
                endif
    Thread can be closed.
    Be well - whoever you are.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts