Results 1 to 5 of 5

Thread: App is still in the background when its suppose 2 end

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    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

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Don't use end.It is a bad programming habit.Use
    Code:
    Unload Form
    Instead.End just forces the app to close without freeing up memory.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    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.

  4. #4
    Guest
    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.

  5. #5
    Guest
    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
  •  



Click Here to Expand Forum to Full Width