Results 1 to 5 of 5

Thread: Exiting a program?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    54

    Exiting a program?

    How do you exit a program, for example if I have an Exit menu command what code do I use to exit the program?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    'Unload all forms

    Public Sub UnloadFrms
    Dim Form As Form
    For Each Form in Forms
    Unload Form
    Set Form = Nothing
    Next Form
    End Sub

    'in your unload event exit menu
    Call UnloadFrms

    If you have loaded any objects you should
    Close them and set them to nothing as well
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    rsitogp
    Guest
    What HeSaidJoe described is the best way to exit, it releases all memory used by your app then common (and incorrect) way to exit is to use:
    Code:
    End

  4. #4
    Matthew Gates
    Guest
    Originally posted by rsitogp
    What HeSaidJoe described is the best way to exit, it releases all memory used by your app then common (and incorrect) way to exit is to use:
    Code:
    End

    It's not incorrect, you just should never use it alone. So with Wayne (HeSaidJoe)'s code, you can always put it after the Next.

  5. #5
    Megatron
    Guest
    Actually, it's the other way around. Joe's way is correct, and using End is incorrect. This is because End does not trigger any of the unload events. You can however, as Matthew Gates suggested, used End after you finish using Unload.

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