Gerry,
Just looking at the first message in the thread...
The problem is the multiple termination points (next x) for the loop. The language sees the first one and terminates the loop scope. The second "next x" is not tied to an open "for" statement and the translator declares an error.
As you found, your flow using the goto behaves the way you want because there is only one "next x".
However, looking at the message a little closer, you could restate the problem slightly.
Your current approach is to skip the work if the adjacent coordinates are the same. Another way to look at it is: You want to do the work if the adjacent coordinates are different.
So this should do what you want:
For x = 1 to 50 (not really using 50)
If coord(x) <> coord(x-1) then
(do stuff here)
end if
Next x
Dave |