Just to clarify for newer scripters:  My understanding is that it's
good to set global objects to Nothing when you're done with them, but
not necessary to do that for local variables in a sub or function,
because they go away automatically when the sub or function exits.

If I'm wrong about this for VBScript, please let me know.  Or
Javascript for that matter.

On Wed, Oct 20, 2010 at 12:39:42PM -0400, Aaron Smith wrote:

   On 10/20/2010 12:06 PM, J.J. Meddaugh wrote:

   doesn't leaving the hotkeys in memory pose memory issues, etc? I
   thought it was a best practice to clean up as much as possible.

   When we talk about cleaning up after yourself, that typically refers
   to creating or storing objects, and then removing references to them
   when those objects are no longer being used. For example, it would be
   good practice in your sub to set your win variable to Nothing when
   you're done with it. That being said, Window-Eyes will take care of
   freeing up memory taken up by your script when your script exits.
   But whether or not you use the filter by parameter in RegisterHotkey
   comes down to how utilitarian you want to be. The filter parameter
   method is most certainly acceptable; that's why it's there. Hot keys
   in memory, even when they're not being used, add up to a negligible
   amount of overhead.
   Aaron
   --
Aaron Smith 
Product Support Specialist * Web Development
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com

To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:[email protected]  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller

Reply via email to