The GW-Scripting list is a discussion list for information regarding the development and use of Window-Eyes scripts. Any subscriber of the GW-Scripting list has the ability to post on-topic messages.
From:
"Chip Orange" <lists3717@comcast.net>Subject:
RE: OnQuitDate:
Sun, Jun 17, 2012 8:43:21 pmBruce,
Yes, true enough. I've seen a short article BTW, where the author uses the
terminate event of a class to emulate the "Try ... Catch ... Continue"
structure found in other languages, by constructing a class around the
command you may want to "try" and using the termination event of the class
for the "catch" portion.
FYI, it may interest you, I just came across an app written by Jamal some
time back, and it's name is invoke.net; it allows you to use .net functions
from something like VBScript by use of an interpretted intermediate language
named boo. He has created a shared object for evaluating BOO commands,
which you can call from VBScript, and BOO commands can reference .net name
spaces and make use of the .net runtime.
So, if you or Rick want to end up writing an app which needs the .net
runtime, but you don't want to do it in Visual Studio, you could learn this
BOO language to give your VBScript access to .net.
The only trouble at the moment is that some of Jamal's apps aren't being
shown by the AppGet app (I believe they could be missing a category), and so
you have to go through the App Central web site to download the invoke.net
app.
hth,
Chip
> -----Original Message-----
> From: BT [mailto:bronx_lab@fltg.net]
> Sent: Sunday, June 17, 2012 4:13 PM
> To: gw-scripting@gwmicro.com
> Subject: Re: OnQuit
>
>
> HI Chip,
>
> I understand that. I think you will find the
> documentation looks for those things to be there. Even if he
> did not know if stuff was taken out of memory, the normal
> procedure is to have the terminate event inside of all
> classes, even those he is not aware of.
> So, if he creates objects and such, they, themselves,
> execute there own terminate procedure when an app is shut
> down, or when an error happens.
> In some cases, such as errors, this terminate event could
> be used for error capture as well if I understand it
> correctly. But, no one knows for sure if all memory is
> released, but must assume so in modern day interpreters;
> which new ones people have written on open source projects
> always tend to have to deal with.
>
> I just gave him another process to use in his
> experimentation and such.
> Bruce
>
> Sent: Sunday, June 17, 2012 12:56 PM
> Subject: RE: OnQuit
>
>
> Bruce, it's a fine example of a VBScript class, but the
> variables in a VBScript app get destroyed whether you have a
> terminate event for a class or not, which was David's
> original question.
>
> Chip
>
>
> > -----Original Message-----
> > From: BT [mailto:bronx_lab@fltg.net]
> > Sent: Sunday, June 17, 2012 8:33 AM
> > To: gw-scripting@gwmicro.com
> > Subject: Re: OnQuit
> >
> >
> > Hi David,
> >
> > Below is what I was referring to, Chip is partly
> correct, but when
> > a crash happens there is a call to the terminate process done, and
> > most classes, if not all of them have a terminate process, which
> > allows the interpreter to call that process.
> >
> > This is a simple class example you can study along with the
> link for
> > more
> > details:
> > Class TestClass
> > Private Sub Class_Initialize ' Setup Initialize event.
> > MsgBox("TestClass started")
> > End Sub
> > Private Sub Class_Terminate ' Setup Terminate event.
> > MsgBox("TestClass terminated")
> > End Sub
> > End Class
> > Set X = New TestClass ' Create an instance of TestClass.
> > Set X = Nothing ' Destroy the instance.
> >
> > Dave listen to what you get in both cases and you will get
> the start
> > and end message box of the class respectively in this example.
> >
> > References:
> > http://msdn.microsoft.com/en-us/library/273zc69c(v=vs.85).aspx
> > Bruce
> >
> > Sent: Saturday, June 16, 2012 1:01 PM
> > Subject: RE: OnQuit
> >
> >
> > Hi David,
> >
> > Unfortunately Bruce's answer isn't applicable to VBScript; we can
> > only guess. My guess is that yes, the interpreter does clear all
> > memory used by an app when it closes.
> >
> > As for an event which executes when your app closes,
> there's an event
> > hidden away in the clientInFormation object named
> onShutdown (it would
> > be nice of the manual had a "see also"
> > section, and in this case if the onQuit event would reference the
> > onShutdown event; more than once I've wished for "see also" help).
> >
> > here's a little example:
> >
> > x=connectevent(clientinformation, "onShutdown", "onShutdown")
> >
> > sub onShutdown()
> > clipboard.appendText "onShutdown was called"
> > end sub
> > I don't believe you can do something such as put up a
> dialog or open a
> > message box in the onShutdown event, I believe WE will soon
> kill your
> > app and those will go away.
> > Don't forget, if you are covering all bases, you may need
> to look into
> > the onError event, which will fire if your app has an error
> (in which
> > case, I'm not sure if onShutdown will fire).
> >
> > hth,
> >
> > Chip
> >
> > ________________________________
> >
> > From: David [mailto:elephant@tele2.no]
> > Sent: Friday, June 15, 2012 7:07 PM
> > To: gw-scripting@gwmicro.com
> > Subject: OnQuit
> >
> >
> >
> > When connecting to the OnQuit Event, I do understand I can create a
> > sub, named things like OnQuit. Here, I could do a bit of house
> > cleaning for my app. But from what I can read in the
> Reference manual,
> > it seems this event only does fire when WE as a total is
> closing down.
> > Am I understanding it correct?
> >
> > If so, is there a way for me to do house cleaning, even if a user
> > turns off the app itself, but keeps WE running? Any Event
> that fires,
> > when an app is stopped or being disabled?
> >
> > Another techie thing:
> > Say my app is using 10Kb of memory for different objects and stuff.
> > I try to be in a habit of always setting objects that are
> not in use
> > to NOTHING. But imagine my app being poorly designed, not
> doing this
> > kind of nullifying. If now the user stop the app - in the
> app manager
> > - and then restart the app. Will the app be using the SAME physical
> > 10kb of memory, or will it create allocations for new 10kb? I.e, if
> > the app is stopped and restarted 100 times, will it still only
> > allocate the same memory, or will there be a risk of memory usage
> > building up?
> > Hope this makes sense.
> >
> >
> >
>
Yes, true enough. I've seen a short article BTW, where the author uses the
terminate event of a class to emulate the "Try ... Catch ... Continue"
structure found in other languages, by constructing a class around the
command you may want to "try" and using the termination event of the class
for the "catch" portion.
FYI, it may interest you, I just came across an app written by Jamal some
time back, and it's name is invoke.net; it allows you to use .net functions
from something like VBScript by use of an interpretted intermediate language
named boo. He has created a shared object for evaluating BOO commands,
which you can call from VBScript, and BOO commands can reference .net name
spaces and make use of the .net runtime.
So, if you or Rick want to end up writing an app which needs the .net
runtime, but you don't want to do it in Visual Studio, you could learn this
BOO language to give your VBScript access to .net.
The only trouble at the moment is that some of Jamal's apps aren't being
shown by the AppGet app (I believe they could be missing a category), and so
you have to go through the App Central web site to download the invoke.net
app.
hth,
Chip
> -----Original Message-----
> From: BT [mailto:bronx_lab@fltg.net]
> Sent: Sunday, June 17, 2012 4:13 PM
> To: gw-scripting@gwmicro.com
> Subject: Re: OnQuit
>
>
> HI Chip,
>
> I understand that. I think you will find the
> documentation looks for those things to be there. Even if he
> did not know if stuff was taken out of memory, the normal
> procedure is to have the terminate event inside of all
> classes, even those he is not aware of.
> So, if he creates objects and such, they, themselves,
> execute there own terminate procedure when an app is shut
> down, or when an error happens.
> In some cases, such as errors, this terminate event could
> be used for error capture as well if I understand it
> correctly. But, no one knows for sure if all memory is
> released, but must assume so in modern day interpreters;
> which new ones people have written on open source projects
> always tend to have to deal with.
>
> I just gave him another process to use in his
> experimentation and such.
> Bruce
>
> Sent: Sunday, June 17, 2012 12:56 PM
> Subject: RE: OnQuit
>
>
> Bruce, it's a fine example of a VBScript class, but the
> variables in a VBScript app get destroyed whether you have a
> terminate event for a class or not, which was David's
> original question.
>
> Chip
>
>
> > -----Original Message-----
> > From: BT [mailto:bronx_lab@fltg.net]
> > Sent: Sunday, June 17, 2012 8:33 AM
> > To: gw-scripting@gwmicro.com
> > Subject: Re: OnQuit
> >
> >
> > Hi David,
> >
> > Below is what I was referring to, Chip is partly
> correct, but when
> > a crash happens there is a call to the terminate process done, and
> > most classes, if not all of them have a terminate process, which
> > allows the interpreter to call that process.
> >
> > This is a simple class example you can study along with the
> link for
> > more
> > details:
> > Class TestClass
> > Private Sub Class_Initialize ' Setup Initialize event.
> > MsgBox("TestClass started")
> > End Sub
> > Private Sub Class_Terminate ' Setup Terminate event.
> > MsgBox("TestClass terminated")
> > End Sub
> > End Class
> > Set X = New TestClass ' Create an instance of TestClass.
> > Set X = Nothing ' Destroy the instance.
> >
> > Dave listen to what you get in both cases and you will get
> the start
> > and end message box of the class respectively in this example.
> >
> > References:
> > http://msdn.microsoft.com/en-us/library/273zc69c(v=vs.85).aspx
> > Bruce
> >
> > Sent: Saturday, June 16, 2012 1:01 PM
> > Subject: RE: OnQuit
> >
> >
> > Hi David,
> >
> > Unfortunately Bruce's answer isn't applicable to VBScript; we can
> > only guess. My guess is that yes, the interpreter does clear all
> > memory used by an app when it closes.
> >
> > As for an event which executes when your app closes,
> there's an event
> > hidden away in the clientInFormation object named
> onShutdown (it would
> > be nice of the manual had a "see also"
> > section, and in this case if the onQuit event would reference the
> > onShutdown event; more than once I've wished for "see also" help).
> >
> > here's a little example:
> >
> > x=connectevent(clientinformation, "onShutdown", "onShutdown")
> >
> > sub onShutdown()
> > clipboard.appendText "onShutdown was called"
> > end sub
> > I don't believe you can do something such as put up a
> dialog or open a
> > message box in the onShutdown event, I believe WE will soon
> kill your
> > app and those will go away.
> > Don't forget, if you are covering all bases, you may need
> to look into
> > the onError event, which will fire if your app has an error
> (in which
> > case, I'm not sure if onShutdown will fire).
> >
> > hth,
> >
> > Chip
> >
> > ________________________________
> >
> > From: David [mailto:elephant@tele2.no]
> > Sent: Friday, June 15, 2012 7:07 PM
> > To: gw-scripting@gwmicro.com
> > Subject: OnQuit
> >
> >
> >
> > When connecting to the OnQuit Event, I do understand I can create a
> > sub, named things like OnQuit. Here, I could do a bit of house
> > cleaning for my app. But from what I can read in the
> Reference manual,
> > it seems this event only does fire when WE as a total is
> closing down.
> > Am I understanding it correct?
> >
> > If so, is there a way for me to do house cleaning, even if a user
> > turns off the app itself, but keeps WE running? Any Event
> that fires,
> > when an app is stopped or being disabled?
> >
> > Another techie thing:
> > Say my app is using 10Kb of memory for different objects and stuff.
> > I try to be in a habit of always setting objects that are
> not in use
> > to NOTHING. But imagine my app being poorly designed, not
> doing this
> > kind of nullifying. If now the user stop the app - in the
> app manager
> > - and then restart the app. Will the app be using the SAME physical
> > 10kb of memory, or will it create allocations for new 10kb? I.e, if
> > the app is stopped and restarted 100 times, will it still only
> > allocate the same memory, or will there be a risk of memory usage
> > building up?
> > Hope this makes sense.
> >
> >
> >
>




