views:

1864

answers:

7

HI,

How can I convert javascript in to vbscript? I am making a script entriely using vbscript. But for some sections i got code in javascript.

A: 

The only thing I found is this comparison chart of a VBScript to Javascript converter:

http://slingfive.com/pages/code/scriptConverter/construct_map.html

splattne
+1  A: 

It would depend on the complexity of the Javascript. Javascript is capable of expressing things impossible to achieve as simply in VBScript.

Even assuming the Javascript is a relative straight forward set of functions its still a manual job.

AnthonyWJones
+4  A: 

If this is for a Windows Scripting Host script (one that you will run via cscript or wscript) you can make your main VBScript file a WSF file, then include the JavaScript file and use its classes and functions within your VBScript; there would be no need to convert it.

See MSDN: Using Windows Script Files (.wsf) for more info.

Patrick Cuff
A: 

Dim vbInformation, vbOkOnly

vbInformation = 64

vbOkOnly = 0

MsgBox "VBScript can also do things that JavaScript can't.", vbInformation+vbOkOnly, "Stack Overflow Answers"


MsgBox Function (Visual Basic) http://msdn.microsoft.com/en-us/library/139z2azd.aspx

ssorrrell
+1  A: 

You can convert VB to JS but JS to VB.. that's just crazy talk. PS, if anyone can do this, I have a stash of scrap metal that I've been trying to turn into gold for about 4 years now.

novatv.stdios
A: 

http://slingfive.com/pages/code/scriptConverter/demo.html this one doesnt work for me...

powtac
A: 

I too prefer VB over js. Its kind of like that old thing of what car brand do you prefer, Ford or Holden. Those who say they prefer Ford or Holden have obviously never driven a Porche ;)

fred