|
-
Oct 8th, 2000, 02:45 PM
#1
Thread Starter
Junior Member
What reasons could there be if the app is still in the list when u ctrl+alt+del, when its suppose 2 unload, I've used the end command ?
Thanks
-
Oct 8th, 2000, 02:53 PM
#2
Frenzied Member
Don't use end.It is a bad programming habit.Use
Instead.End just forces the app to close without freeing up memory.
-
Oct 8th, 2000, 02:55 PM
#3
Frenzied Member
In some cases you can use End:
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
End
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 8th, 2000, 03:42 PM
#4
Or, another use is:
Code:
'Module Code
Sub Main()
...
Proc1
...
End Sub
Sub Proc1()
...
Proc2
...
End Sub
.
.
.
Sub Procn()
...
End
...
...
End Sub
another use for End, for you can't unload a module and just Exit Sub is too complicated.
-
Oct 8th, 2000, 07:36 PM
#5
Originally posted by Jop
In some cases you can use End:
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
End
End Sub
This is the best way to go.
Set Form = Nothing - Clears up any resources a form is using.
Unload Me - Unloads a form or control from memory.
End - Terminates execution. Never required by itself but may be placed anywhere in a procedure to close files opened with the Open statement and to clear variables.
Notice: See the End statement, never use it by itself (in Bold).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|