Can a While have something like an Else?

  • Thread starter Thread starter Trint Smith
  • Start date Start date
T

Trint Smith

I have a While drSQL.Read()
do something
End While

I need the While so I can't use the else and don't know what the
alternate condition of the drSQL.Read() could be.

BUT, if the While loop is not entered I need it to do something
different.
Any help is appreciated.
Thanks,
Trint

..Net programmer
(e-mail address removed)
 
Hi Trint,

You can develop an 'if' condition inside the while loop and use 'loop' to
loop out of it if appropriate.

HTH,

Bernie Yaeger
 
You can use a flag to test if you entered the while loop

Dim bFoundSome = false
While drSQLRead()
bFoundSome = true
End while
If not bFoundSome then ....

There are a bunch of other ways to do.
 
Back
Top