Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: David on March 26, 2004, 11:59 AM

Title: Problem
Post by: David on March 26, 2004, 11:59 AM
I run my bot, and when i exit it, i ctrl + alt + del , and then the bot is still in there....how do i fix  this?
Title: Re:Problem
Post by: Networks on March 26, 2004, 12:07 PM
Private Sub Form_Unload
Unload Me
End
End sub

*Make sure you unload the rest of the forms you: Unload FrmExample

Title: Re:Problem
Post by: Dyndrilliac on March 26, 2004, 08:30 PM
End is a catch-all for any forms still running. Just make End on whatever procedure you want the program to close on.
Title: Re:Problem
Post by: Spht on March 26, 2004, 10:08 PM
Quote from: Networks on March 26, 2004, 12:07 PM
Private Sub Form_Unload
Unload Me
End
End sub

*Make sure you unload the rest of the forms you: Unload FrmExample



Note that Unload <object> is what triggers Form_Unload, so calling it again is redundant. Avoid using End since it kills process without cleaning up any used memory. On unload, you should free all the memory you were using up by unloading any other forms which are running, clear arrays, terminate classes (VB may handle this automatically for you, not sure off hand), etcetera.