html5 - VBScript alternative/conversion? -


i have piece of code long time ago , trying integrate html5. it's written in vbscript, no longer supported, , want change understood modern browsers. part of hta file, in works fine in html5 except script. appreciated.

the code:

</style> <font color="#ff0000" size="+3"><marquee>marquee text here</marquee></font> <script language="vbscript"> public n, itimerid, mytitle, colnum, carset redim m(1,1) redim speccar(64) speccar(0)="&permil;"  speccar(1)="&fnof;"   : speccar(11)="&omega;"   : speccar(21)="&lambda;" : speccar(31)="&phi;" speccar(2)="&gamma;"  : speccar(12)="&alpha;"   : speccar(22)="&mu;"     : speccar(32)="&psi;" speccar(3)="&delta;"  : speccar(13)="&beta;"    : speccar(23)="&nu;"     : speccar(33)="&omega;" speccar(4)="&theta;"  : speccar(14)="&delta;"   : speccar(24)="&xi;"     : speccar(34)="&trade;" speccar(5)="&lambda;" : speccar(15)="&epsilon;" : speccar(25)="&pi;"     : speccar(35)="&larr;" speccar(6)="&xi;"     : speccar(16)="&zeta;"    : speccar(26)="&rho;"    : speccar(36)="&uarr;" speccar(7)="&pi;"     : speccar(17)="&eta;"     : speccar(27)="&sigmaf;" : speccar(37)="&rarr;" speccar(8)="&sigma;"  : speccar(19)="&iota;"    : speccar(29)="&tau;"    : speccar(39)="&harr;" speccar(10)="&psi;"   : speccar(20)="&kappa;"   : speccar(30)="&upsilon;": speccar(40)="&radic;" speccar(41)="&infin;" : speccar(46)="&there4;"  : speccar(51)="&ge;"     : speccar(56)="&clubs;" speccar(42)="&ang;"   : speccar(47)="&asymp;"   : speccar(52)="&oplus;"  : speccar(57)="&hearts;" speccar(43)="&cap;"   : speccar(48)="&ne;"      : speccar(53)="&perp;"   : speccar(58)="&diams;" speccar(44)="&cup;"   : speccar(49)="&equiv;"   : speccar(54)="&loz;"    : speccar(59)="&oelig;" speccar(45)="&int;"   : speccar(50)="&le;"      : speccar(55)="&spades;" : speccar(60)="&dagger;" speccar(61)="&dagger;": speccar(62)="&euro;"    : speccar(63)="&oelig;"  : speccar(64)="&scaron;"  sub window_onload()     n = 48     colnum = 100     carset = 1     redim m(colnum,1)     ' set random number first character      ' written on screen each column      ' (div). useful avoid     ' column start @ same place      i=1 colnum         randomize                                   '---this formula doesn't accept variables         m(i,0) = int(n*rnd)                         '--- m(i,0) contains number of character written         t = ""                                                     '--- fill column white space         j=1 n             t = t & "&nbsp;<br>"         next         m(i,1) = t                                  '--- m(i,1) contains html of column     next     itimerid = window.setinterval("progress", 300) end sub  sub progress     i=1 colnum         l = split(m(i,1), "<br>")                   '--- split each character in column         cpos = m(i,0)                               '--- position of character written on screen @ time                                                     '--- write random ascii or character array          randomize         if int(carset) = 1             l(cpos) = "<span style=""color:greenyellow"">" & chr( 32 + int(223*rnd) ) & "</span>"             carset = carset +0.25         elseif int(carset) = 2             l(cpos) = "<span style=""color:greenyellow"">" & speccar( int(64*rnd) )  & "</span>"             carset = 1         end if                                                     '--- scale down dark previous characters         y = -1         j = cpos-1 cpos-11 step -1             tempj = j             if j < 0                           '--- when start top, darken characters @ bottom                 j = ubound(l) +j +1             end if             y = y + 1             select case y                 case 0 color="lawngreen"                 case 1 color="lawngreen"                 case 2 color="limegreen"                 case 3 color="limegreen"                 case 4 color="forestgreen"                 case 5 color="forestgreen"                 case 6 color="green"                 case 7 color="green"                 case 8 color="darkgreen"                 case 9 color="darkgreen"                 case 10 color=""             end select             clj = l(j)             if instr(1, clj, "<span", 1) > 0   '--- isolate character span tag                 clj = left(clj, instrrev(clj, "<") - 1)                 clj = mid(clj, instr(clj, ">") + 1)             end if             if color <> ""                     '--- set span color style if necessary                 l(j) = "<span style=""color:" & color & """>" & clj & "</span>"             else                 l(j) = clj             end if             j = tempj         next         t = join(l, "<br>")         m(i,1) = t                                  '--- m(i,1) contains html of column         cpos = cpos +1         if cpos > ubound(l)             cpos = 0         end if         m(i,0) = cpos                               '--- m(i,0) contains number of character written         id("col" & i).innerhtml = t                 '--- show result column on screen     next end sub  sub exitmatrix     window.clearinterval(itimerid)                  '---you must clear intervals before leaving     window.close end sub  function id(o)     set id = document.getelementbyid(o) end function </script> 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -