Results 1 to 9 of 9

Thread: program wont close

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    37
    I'm using the Unload Me command to exit the program. The program closes but doesn't actually exit (using ctrl-alt-delete, the program shows as still running).

    I'f never run into this problem with other programs i've developed.

    Any suggestions?

  2. #2
    Guest
    Code:
    Unload Me
    Set Form1 = Nothing
    End

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    End is evil!
    Click this smile icon:

  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hi,

    you shoud be carefull because when you see this type of error, it usually means that something is working wrong !

    Do you have "For ever" loops in your applcation, ie : are you purely programming with events and function or do you have functions that never exit your code ? This could be a reason that the form is always loaded into the Forms collection...

    Also, is there a possibility that your programm calls for graphical controls on your form after the form unload as been called ? If so, the form WILL BE RELOADED.

    Do some testing, put a break point into your form load event and close your application...

    Hope I helped...


    P.S. Do you speak french ( bonjour !!!) because if so, I could write it down in french, I'am from Québec Canada...

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Yonatan, End is used to end applications, all apps arent always bound to forms and objects.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    BTW, search all doevents statement and make emergency exits on at least the most your fequently used loops, for instance:
    Code:
    Do
      'code
      Doevents
    Loop While Forms.count
    and
    Code:
    Do
      'code
      Doevents
      If forms.count=0 then exit do
      'code
      Doevents
    Loop While Forms.count

    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hey guys...

    Normally, applications should exit when there is no more forms in the Forms collections. That the way it's meant to be and it's the cleanest way to close an application.

    When I see the END statement in someone's application (at work or else), 2 things run into my mind :

    1) " Wow this guy really wanted me to know he was a VB programmer !!! "

    2) " Now, what was going so bad in this application that the guy decided to PATCH a clean unload with the END statement ? "

    There is something wrong into this application "Bonjour", think about it...

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Thumbs down Hmm, and three more hmm's

    i did some tests again, none of the objects declared in standard modules unloads correctly, when you close the last form. Thats exactly the same symptoms as caused by End. Unload statement is Evil! Nah, But think about it, Standard Modules surely must be evil, if you use them, i can't think of a better way to end your app, without manually unloading all objects and variables in that module.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Hyperactive Member D12Bit's Avatar
    Join Date
    Oct 2000
    Location
    Guatemala
    Posts
    373

    Question What about this?

    maybe and just maybe you have one form not visible, that´s
    what happend to me once, i was opening another form to
    display some information and y simply hide it after that
    but when i use the Unload Me statment the app continue
    runnig, until i found that mistake...


    Saludos...
    "Who Dares Wins" - "Quien se Arriesga Gana"
    Mail me at:

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