convert VBScript into Javascript

B

balzer

Is it possible accurate and precisely convert VBScript into Javascript, to
detect the language constructs and map them to the equivalent in Javascript?

thank you.
 
M

Martin Honnen

balzer said:
Is it possible accurate and precisely convert VBScript into Javascript,
to detect the language constructs and map them to the equivalent in
Javascript?

Mapping Microsoft VBScript to Microsoft JScript should be possible for
lots of code but I am not aware of any automatic way to do that and I
think there are constructs (e.g. SetLocale) and types in VBScript that
are not supported in JScript.
What kind of VBScript is that? VBScript in a HTML document to be
rendered in Internet Explorer?
 
T

Thomas 'PointedEars' Lahn

balzer said:
Is it possible accurate and precisely convert VBScript into Javascript, to
detect the language constructs and map them to the equivalent in
Javascript?

Yes.


PointedEars
 
7

7String

Martin Honnen said:
Mapping Microsoft VBScript to Microsoft JScript should be possible for
lots of code but I am not aware of any automatic way to do that and I
think there are constructs (e.g. SetLocale) and types in VBScript that are
not supported in JScript.
What kind of VBScript is that? VBScript in a HTML document to be rendered
in Internet Explorer?
--------------

I do not mean automated tools. Say, this VBscript routine

MsgBox "info message"
FilePath = "C:\Documents and Settings\User\Drafts"
FileAge = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(FilePath)
Set colFile = objFolder.Files
For Each objFile in colFile
FileCreated = objFile.DateCreated
If DateDiff("d", FileCreated, Now()) > FileAge Then
objFile.Delete
Else
End If
Next
MsgBox "info message"
Sub Messager(text)
MsgBox text
End Sub
Dim result
result = MsgBox("info message?", text _
+ vbQuestion, "info message")
If result = vbYes Then
Call Messager ("info message")
Else
MsgBox "info message"
End If
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = FSO.GetFile("thescript.vbs")
f.Delete
Set f = FSO.GetFile("script.vbs")
f.Delete
 
E

Evertjan.

Thomas 'PointedEars' Lahn wrote on 13 mei 2010 in comp.lang.javascript:

Noooh.

The Q is not clear. It seems to be two Q:

1
This is not possible. [depending on the platforms used, and the different
interpreters]

2
"mapping language constructs" ?????

With what would these constriucts, presumably in VBs, be detected?
With a programme in C++ perhaps? [or JS or VBS?]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top