Results 1 to 7 of 7

Thread: Problem to exit App

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    When exit my App it still remainding in the Task List.

    Any idea about it?

    Ulises Vázquez
    [size=1.7]Oracle DBA Certified Professioanl
    Visual Basic 6 Developer
    Crystal Reports Designer
    [/size]

  2. #2

  3. #3
    Guest

    Exclamation NEVER USE END BY ITSELF

    Sorry, but the MSDN Library says so itself .

    Use this code:

    Code:
    Private Sub UnloadAllForms()
    
    Dim Form As Form
    
    For Each Form In Forms
    
    Unload Form
    
    Set Form = Nothing
    
    Next Form
    
    End Sub

  4. #4

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496

    Talking

    End stops execution right then and there, not allowing for any "housekeeping", if you do use end, throw it in the form query unload event, after matheews code.

  6. #6
    Guest
    Well, the END statement can be used. But in the MSDN Library, it says, "Never required by itself" or something like that. End won't end the program, resources that your program is using will still be there. The UNLOAD statement will clear up any resources used by the form and unload the form.
    Set Form = Nothing
    ..can be used as well.

    And as Lethal said, End can be put after all that code.

    Code:
    Private Sub UnloadAllForms()
         Dim Form As Form
         For Each Form In Forms
              Unload Form
              Set Form = Nothing
         Next Form
         End
    End Sub
    I usually do something like:

    Unload Me
    Set Form1 = Nothing
    End

    I like to use them all .
    But never use End by itself!

  7. #7
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    End Terminates execution immediately. Never required by itself but may be placed anywhere in a procedure to end code execution, close files opened with the Open statement and to clearvariables.

    End Function Required to end a Function statement.
    End If Required to end a block If…Then…Else statement.
    End Property Required to end a Property Let, Property Get, or Property Set procedure.
    End Select Required to end a Select Case statement.
    End Sub Required to end a Sub statement.
    End Type Required to end auser-defined type definition (Type statement).
    End With Required to end a With statement.
    Read into it what you will. What I think it says is DON'T USE IT!

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