swingingming wrote:
If some condition is met, I would like to move to the next record. I
tried 'Exit Do', which exits, this is not what i want; i tried 'break'
or 'continue loop', none of them works. so, now i used a label with
GoTo clause.
I am just wondering what is the correct syntax?
Thanks, ming
The exit do is the correct syntax. Or you can have the same or a
different condition itself in the do while statement.
For example, the following is building a string, strRoute (for a list of
hexes along a straight line in a hexagonal overlay of a map):
Do While intCount <= Abs(dy)
lngY = lngY + Sgn(dy)
lngx = lngx + Sgn(dy)
strRoute = strRoute & "," & lngY & "-" & lngx & "," & lngY
& "-" & lngx - Sgn(dy)
intCount = intCount + 1
If intCount > Abs(dy) Then Exit Do
lngY = lngY + Sgn(dy)
strRoute = strRoute & "," & lngY & "-" & lngx
intCount = intCount + 1
Loop
The exit do takes it to the line immediately following the loop line.
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto