Re: Syntax to QUIT the running App - To Clarify...
- From: "M. Posseth" <MPosseth@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Sep 2005 04:32:03 -0700
well Mike don`t fall in the same pitfall as i did when dealing with this
person
we all know that using End to terminate a forms applcation in VB is bad
coding parctice
Maybe you now understand the mistake i made when dealing earlier with this
person , and you said so yourself we are paticipating in this newsgroup to
help and learn from each other, not to have childish arguments
the only situation when End might be valid to use is in a module only app
<!------ explanation for those who might be interested
When executed, the End statement resets all module-level variables and all
static local variables in all modules. To preserve the value of these
variables, use the Stop statement instead. You can then resume execution
while preserving the value of those variables.
Note The End statement stops code execution abruptly, without invoking the
Unload, QueryUnload, or Terminate event, or any other Visual Basic code. Code
you have placed in the Unload, QueryUnload, and Terminate events of forms and
class modules is not executed. Objects created from class modules are
destroyed, files opened using the Open statement are closed, and memory used
by your program is freed. Object references held by other programs are
invalidated.
The End statement provides a way to force your program to halt. For normal
termination of a Visual Basic program, you should unload all forms. Your
program closes as soon as there are no other programs holding references to
objects created from your public class modules and no code executing.
----->
"MikeD" wrote:
>
> "Bob Butler" <tiredofit@xxxxxxxxxx> wrote in message
> news:ekoKJUzrFHA.3080@xxxxxxxxxxxxxxxxxxxxxxx
> > "Ted" <2000@xxxxxxxxxx> wrote in message
> > news:%23quNP2yrFHA.2768@xxxxxxxxxxxxxxxxxxxx
> >> This helps:
> >>
> >> Private Sub Command1_Click()
> >> Unload Me
> >> End Sub
> >>
> >> Private Sub Form_Unload(Cancel As Integer)
> >> Call iEnd
> >> End Sub
> >> Public Sub iEnd()
> >> End
> >> End Sub
> >
> > NO. VB apps *never* need to use END and using it when the app is not
> > already ending wthout it can result in problems as resources may not be
> > properly released. Unload all forms and make sure that no code is running
> > and your app will end cleanly.
>
>
> This should be interesting.... let's see if Ted takes potshots at Bob and
> Rick for criticizing his code. <g>
>
> If *I* had made this very same comment about using End, you can bet he'd say
> I didn't know what I was talking about (and that I probably read in a book
> that End was bad).
>
> I'm not trying to start anything anew, Ted, so don't get all defensive. I
> just find it interesting how your "reaction" is based on *who* replied,
> rather than *what* was said in the reply.
>
> --
> Mike
> Microsoft MVP Visual Basic
>
>
>
.
- Follow-Ups:
- Re: Syntax to QUIT the running App - To Clarify...
- From: MikeD
- Re: Syntax to QUIT the running App - To Clarify...
- From: Björn Holmgren
- Re: Syntax to QUIT the running App - To Clarify...
- References:
- Syntax to QUIT the running App
- From: Kahuna
- Re: Syntax to QUIT the running App - To Clarify...
- From: Kahuna
- Re: Syntax to QUIT the running App - To Clarify...
- From: Duane Bozarth
- Re: Syntax to QUIT the running App - To Clarify...
- From: Bob Butler
- Re: Syntax to QUIT the running App - To Clarify...
- From: MikeD
- Syntax to QUIT the running App
- Prev by Date: RE: Controls in VB for Flash
- Next by Date: Re: Native Code vs PCode
- Previous by thread: Re: Syntax to QUIT the running App - To Clarify...
- Next by thread: Re: Syntax to QUIT the running App - To Clarify...
- Index(es):
Relevant Pages
|