Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exist do in the second while but I want to exit from the first while 1

Status
Not open for further replies.

RSX02

Programmer
May 15, 2003
467
CA
Hi
I have 2 while
One in the first one.
so I have
Do While ...
....
do while...
...
if myfield <> 0 then
' Here I want to exist from my first do while
end if
loop
loop

How can I do that?
I tried
&quot;exit do
exit do&quot; (twice)
but it doesn't seem to work.
Thanks in advance
 
There are several ways to do it, largely dependant on the what the actual Do While conditions are.

I am not a fan of using Exit Do, or Exit For, as they are, ideal programming constructs, but if you share what your Do While conditions are, we might be able to help.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Hi,

Not knowing the real intent of your logic...
Code:
Do While ...
  ....
  do while...
     ...
     if myfield <> 0 then Exit Do
  loop
  if myfield <> 0 then Exit Do
  ...
loop
:)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top