converter

Script Converter
map of code constructs & progress

= example(s) to pattern

VBStoJS

JStoVBS

Language
declare variable , owner: RE , owner: RE
concat string , owner: RE , owner:
statement

, owner: RE
  • \r\n
  • line continuation char _
  • line combination char :

, owner:
  • ; --> vbCRLF
declare proc , owner: RE , owner:
end proc , owner: RE , owner:
proc params
  & open
, owner: RE
  • SUB somesub(p1...)
, owner:
  • function somesub(p1...){
call proc , owner: RE
  • call somesub(p1...)
  • somesub p1
, owner:
  • somesub(p1...)
function return , owner: RE , owner:
if statement

, owner: JW

, owner:

case statement

, owner: JW/RE
  • SELECT CASE
  • still needs multiple cases, eg:  CASE 1,2 --> case 1:/case 2:

, owner:
  • switch

for loop

, owner:
  • FOR x=0 TO n ... NEXT
  • FOR EACH obj IN someCol NEXT ---> ???

, owner:
  • for(var x=0, x<n; x++){...}

do loop , owner: 
comments , owner: RE
  •  '
, owner:
  •  //
  •  /* ... */  
object

, owner: RE
  • CreateObject() / Server.CreateObject()
  • SET
  • nothing

, owner: RE
  • new ActiveXObject()
  • null
dialogs , owner: RE
  • msgbox() --> window.alert()
  • msgbox(..vbYesNo/vbOKCancel...)--> window.confirm()
  • inputbox() --> window.prompt()
n/a
language
constants
, owner: RE
  • vbOK, vbCancel, vbYes, vbNo, vbCRLF, vbTab, vbEmpty..
, owner:
miscellaneous , owner: RE
  • Option Explicit
, owner: RE
  • On Error Goto 0/ On Error Resume Next
, owner: 
trinary operator 
  • (cond ? truepart : falsepart)
DOM adjustments
window object n/a , owner:
  • alert,confirm,prompt, screen,location,event -->
window.$1