Results 1 to 8 of 8

Thread: Proper way to end a program

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Thumbs up

    Sorry to be a pain, I know there has been a post on this before, but can't find it.

    I heard that the end statement was old and is not the best way to stop your vb app from running. Can anyone tell me what you should use to end your app please?

    Many thanks!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    If what you're talking about is just closing the program, basically you can unload all the active forms or the main MDI form.

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Click this smily:

  4. #4

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    a little confused

    Thank you Yonatan, that was the one I was looking for.
    So which is best...

    1) End

    2) Call Unload(Me)

    3) Set Frm = Nothing

    Do these not just do exactly the same thing?
    (pardon my ignorance if they are completly different, I have always been told to do the end one).

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Nope, don't use the end one, use Unload Me.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  6. #6
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Why End is so bad,everybody's telling not to use End,

    WHY??????????

  7. #7
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Because End simulates the effect of you just pressing the Stop button, which means that if you had any code if Form_Unload, Form_QueryUnload or Form_Terminate then it will not be executed. This would waste memory if you had any class modules initialised but not terminated, and could cause a you GPF if you were Subclassing or Hooking and the call that stops that was in, for example, Form_Unload.

    That's why it's bad.

    Done.


    Ok.
    Courgettes.

  8. #8
    Guest
    I use all of them, but than again, that's just me .

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