end program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maarten

    #1

    end program

    hi all

    is there a better way to close a program then use end , becouse i think my
    win 98 doesn't agree with this method.

    there is something strange

    wen i close my program with the button in the frame, it says there has been
    an error an my program has te shut down (not that bad becouse i was closing
    it anyway), but it ain't nice.

    i us the unloadstatement to display a box to confirm.

    but when i close my program with my closebutton i don't get the error

    i tought that when i closed my program with te close button, the
    unloadstatement also runs ( actualy it does, becouse it dispalays the box to
    confirm).

    but why do i get an error when i press the unloadstatement directly and why
    it don't sends an error when i do it via my closebutton.

    realy strange behaviour.

    hope someone knows why

    kind regards maarten.


  • M. Posseth

    #2
    Re: end program

    A better way then to use end ???

    well you should not use end at all !

    End is a reminder of good old basic and may only be used in a program that
    exists only by code modules

    Using end is considered bad programming as it prevents propper cleanup of
    objects loaded in memory

    you should unload all forms , and set all object pointers to nothing this
    will terminate you program

    M. Posseth [MCP]




    "Maarten" <gurkjaan@hotma il.com> wrote in message
    news:4177d083$0 $667$ba620e4c@n ews.skynet.be.. .[color=blue]
    > hi all
    >
    > is there a better way to close a program then use end , becouse i think my
    > win 98 doesn't agree with this method.
    >
    > there is something strange
    >
    > wen i close my program with the button in the frame, it says there has[/color]
    been[color=blue]
    > an error an my program has te shut down (not that bad becouse i was[/color]
    closing[color=blue]
    > it anyway), but it ain't nice.
    >
    > i us the unloadstatement to display a box to confirm.
    >
    > but when i close my program with my closebutton i don't get the error
    >
    > i tought that when i closed my program with te close button, the
    > unloadstatement also runs ( actualy it does, becouse it dispalays the box[/color]
    to[color=blue]
    > confirm).
    >
    > but why do i get an error when i press the unloadstatement directly and[/color]
    why[color=blue]
    > it don't sends an error when i do it via my closebutton.
    >
    > realy strange behaviour.
    >
    > hope someone knows why
    >
    > kind regards maarten.
    >
    >[/color]


    Comment

    Working...