PC Review


Reply
Thread Tools Rate Thread

Can a While have something like an Else?

 
 
Trint Smith
Guest
Posts: n/a
 
      2nd Mar 2004
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 Removed)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Bernie Yaeger
Guest
Posts: n/a
 
      2nd Mar 2004
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

"Trint Smith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Michael Hesse
Guest
Posts: n/a
 
      2nd Mar 2004
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.
"Trint Smith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>



 
Reply With Quote
 
Trint Smith
Guest
Posts: n/a
 
      2nd Mar 2004
Thanks, this will work
Trint

.Net programmer
(E-Mail Removed)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:41 PM.