View Single Post
  #1 (permalink)  
Old 05-22-2007, 06:50 PM
Cableguy's Avatar
Cableguy Cableguy is offline
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,455
Awards Showcase
Forum Contributer 
Total Awards: 1
Default error label and for next loop

Hi,

I have an Error Label inside a for next loop, and when an error is trapped the error label is called but the for next loop is not exited and becomes an endless loop...

Code:
Sub MySub

errorlabel (error)

for x = 0 to 49
D Something
next x

error:
msgbox("file was not created!!",,cMsgBoxOK,cMsgBoxExclamation)

End Sub
How can I exit the loop when the error is trapped?
I've tryed Exit and Return with no success!!
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote