Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: how can i exit from a loop


Message #1 by "taherm@f... on Wed, 28 Nov 2001 16:12:24
scenario



i have a table with 20000 rows



do while not rsSubcats.eof

if catid = rssubcats("catidd") then

catnam=rssubcats("name")

catfound = 1

end if

rsSubcats.movenext

loop 		



what i want to do is say for example if the above find the catid in my 

subcats tablethen i want to exit the loop rather than going through all 

the records till it finds EOF..

ie if it find a catid on the 5th row i want to exit the loop so that i can 

speed up the processing of my page....

is this possible...

Regards

Taher		
Message #2 by Shaun Steckley <SSTECKLEY@P...> on Wed, 28 Nov 2001 11:17:35 -0500
This is the VB "Do Loop" definition, but I am assuming it is defined the

same in VBScript.  Just use the "Exit Do" command...





Do [{While | Until} condition]

[statementblock]

[Exit Do]

[statementblock]



Loop



-----Original Message-----

From: taherm@f...

[mailto:taherm@f...]

Sent: Wednesday, November 28, 2001 11:12 AM

To: ASP Web HowTo

Subject: [asp_web_howto] how can i exit from a loop





scenario



i have a table with 20000 rows



do while not rsSubcats.eof

if catid = rssubcats("catidd") then

catnam=rssubcats("name")

catfound = 1

end if

rsSubcats.movenext

loop 		



what i want to do is say for example if the above find the catid in my 

subcats tablethen i want to exit the loop rather than going through all 

the records till it finds EOF..

ie if it find a catid on the 5th row i want to exit the loop so that i can 

speed up the processing of my page....

is this possible...

Regards

Taher		




$subst('Email.Unsub')



Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks





********************************************************************

The information contained in this email is confidential and

is intended solely for the use of the person identified and

intended as the recipient. If you are not the intended 

recipient, any disclosure, copying, distribution, or taking of

any action in reliance on the contents is prohibited. If you

receive this message in error, contact the sender

immediately and delete it from your computer.



Personal e-mails are restricted by PSECU policy. As such,

PSECU specifically disclaims any responsibility or liability

for any personal information or opinions of the author

expressed in this email.

********************************************************************




  Return to Index