Okay, this may sound like a dumb questions, but here goes. Does VBscript
clear all variables when the script exists cleanly. Yes I am lasy but I
don't want to set everything to "=Nothing" if I don't have too.

Thanks in advance for your help!

Re: Memory cleanup with VBscript by mayayana

mayayana
Tue Jun 21 23:56:07 CDT 2005


> Okay, this may sound like a dumb questions, but here goes. Does VBscript
> clear all variables when the script exists cleanly.

Theoretically, yes, though there's been debate about
whether that always works without fail.

>Yes I am lasy but I
> don't want to set everything to "=Nothing" if I don't have too.
>

If typing "Set x = Nothing"
leaves you out of breath then it's not worth
worrying about. The worst that will happen is that you'll
waste a bit of memory and develop poor
coding habits.
There have been discussions about this topic
recently. One of the MS script programmers even
recommends *against* setting things to Nothing.
I think his argument was that it adds to code clutter
unnecessarily.



Re: Memory cleanup with VBscript by Bob

Bob
Wed Jun 22 01:12:13 CDT 2005

Perfect, now I have an excuse to be sloppy,

Thanks!

"mayayana" <mayaXXyana1a@mindYYspring.com> wrote in message
news:Hb6ue.9688$eM6.2010@newsread3.news.atl.earthlink.net...
>
>> Okay, this may sound like a dumb questions, but here goes. Does VBscript
>> clear all variables when the script exists cleanly.
>
> Theoretically, yes, though there's been debate about
> whether that always works without fail.
>
>>Yes I am lasy but I
>> don't want to set everything to "=Nothing" if I don't have too.
>>
>
> If typing "Set x = Nothing"
> leaves you out of breath then it's not worth
> worrying about. The worst that will happen is that you'll
> waste a bit of memory and develop poor
> coding habits.
> There have been discussions about this topic
> recently. One of the MS script programmers even
> recommends *against* setting things to Nothing.
> I think his argument was that it adds to code clutter
> unnecessarily.
>
>



Re: Memory cleanup with VBscript by D

D
Wed Jun 22 03:14:57 CDT 2005

Then again, there will be times where you'll need to clearup. Instantiate
too many large objects, and you could find your script consuming much more
memory than it need to, and with windows being windows - all manner of
problems may follow.

Myself, I don't usually bother clearing the usual fso, wsh and net objects
etc, but inside tight loops that are called very often, I do clearup
objects.

Being sloppy is one thing, being messy is another. :)



"Bob Smith" <bob@smith.com> wrote in message
news:1j7ue.1774767$6l.737575@pd7tw2no...
> Perfect, now I have an excuse to be sloppy,
>
> Thanks!
>
> "mayayana" <mayaXXyana1a@mindYYspring.com> wrote in message
> news:Hb6ue.9688$eM6.2010@newsread3.news.atl.earthlink.net...
>>
>>> Okay, this may sound like a dumb questions, but here goes. Does VBscript
>>> clear all variables when the script exists cleanly.
>>
>> Theoretically, yes, though there's been debate about
>> whether that always works without fail.
>>
>>>Yes I am lasy but I
>>> don't want to set everything to "=Nothing" if I don't have too.
>>>
>>
>> If typing "Set x = Nothing"
>> leaves you out of breath then it's not worth
>> worrying about. The worst that will happen is that you'll
>> waste a bit of memory and develop poor
>> coding habits.
>> There have been discussions about this topic
>> recently. One of the MS script programmers even
>> recommends *against* setting things to Nothing.
>> I think his argument was that it adds to code clutter
>> unnecessarily.
>>
>>
>
>