473,395 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Javascript equivalent for VBScript

What is Javascript equivalent for this VBScript line:

Set WshShell = Nothing

Thanks.

May 25 '06 #1
3 3897


po*******@softhome.net wrote:
What is Javascript equivalent for this VBScript line:

Set WshShell = Nothing


The following is similar
WshShell = null;
but while with VBScript the Set VarName = Nothing releases system and
memory resources if not other variable refers to it with JavaScript you
have garbage collection which runs periodically or on demand to free
resources.
--

Martin Honnen
http://JavaScript.FAQTs.com/
May 25 '06 #2

Martin Honnen писал(а):
po*******@softhome.net wrote:
What is Javascript equivalent for this VBScript line:

Set WshShell = Nothing
-----------------------
The following is similar
WshShell = null;
but while with VBScript the Set VarName = Nothing releases system and
memory resources if not other variable refers to it with JavaScript you
have garbage collection which runs periodically or on demand to free
resources.
Martin Honnen
http://JavaScript.FAQTs.com/


-----------------------------

I mean the same purpose, release system and free memory resources after
code finished:

var WSHShell;
WSHShell = new ActiveXObject("WScript.Shell");
.... ....

WshShell = null;

is this correct?

May 25 '06 #3
po*******@softhome.net wrote:
I mean the same purpose, release system and free memory resources
after code finished:
var WSHShell;
WSHShell = new ActiveXObject("WScript.Shell");
WshShell = null;
is this correct?


It's correct, yes. But it doesn't do exactly what you're asking.

Read up on Garbage Collection as a programming concept. The whole point is,
you don't get to control when memory and resources are freed. The language
implementation does that for you. You don't need to care. The above code
makes the object _available_ for cleanup, which is all you need to do.

IE has proprietary methods to explicitly call the garbage collector, but you
still can't guarantee that your resources will be freed when you want them
to be.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
May 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Benson | last post by:
Yes, but I was referring to VBScript apart from the runtime children like Dictionary, Network etc., like the C language apart from the Standard Library. I agree, though, Dictionaries are cool,...
5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
13
by: Eric Robinson | last post by:
Hello, My ASP code creates an ADO recordset object on the server. Later on the same page, I have a javascript code snippet that I use to dynamically populate a drop-down box based on choices...
10
by: Jim Ciotuszynski | last post by:
Is there an equivalent to the "button.attributes.add("onBlur","JavaScript:return somfunction();") ? I thought that vbscrpt would also do the same but when I run my code with the vbscript my...
11
by: Doug van Vianen | last post by:
Hi, I often like to include some JavaScript coding in my web pages to make them more interesting. Unfortunately, even when this coding is as simple as a check to see what the display width is in...
21
by: shelleybobelly | last post by:
I'm looking to return DATE ONLY for yesterday's date. No seconds, milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so easily Date()-1 will return 03/27/2007 if today is...
5
by: Sam the Cat | last post by:
Hey All, I am writing some COM code in Python to control photoshop. Several functions of PS require an "Array" argument. In the examples of VBscript or javascript the Array type is used. I...
2
by: 9icj4u613jeqrx8 | last post by:
Hi, I need some help with IE browser programming (in .NET). I'm trying to add a button to the IE toolbar, and on the click of the button open a popup window with a remote URL. Secondly, I'm...
10
by: SanjivaniPant | last post by:
Hi, Does anybody know how to get client locale in javascript. I know vbscript GetLocale function but I am searching its equivalent in javascript. Some sites have mentioned using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.