Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help coverting a VBS chunk to JavaScript 1

Status
Not open for further replies.

ErrorLINE1CHAR1

Programmer
Dec 3, 2010
24
US
Code:
function doMONI_Edit(){
/*IF UPDATES TO THE ACS MONITORING STATUS NEED TO BE MADE, CREATE THE EDIT SCREEN*/
var sHTML;
var lidx;

sHTML =   "<table border='1' width='95%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
sHTML = sHTML + "<tr><td>";
sHTML = sHTML + "<table border='0' width='100%' cellpadding='0'>";
sHTML = sHTML + "<tr>";
sHTML = sHTML + "<td width='100%'><font face='Neo Sans Intel Medium' size='" + cstr(htaFontSize + 2) + "'><b>ACS MONITORING   -   503 . 641 . XXXX - </font><font face='Neo Sans Intel Medium' size='" + cstr(htaFontSize - 1) + "'><b>How long will be in test for? Which part of the Building? Operator Number?</b></font></td>";
sHTML = sHTML + "<td align='right'><button class='clsButton' name='btnMONIsave' value='mon' onmouseover=" + chr(34) + "btnMONIsave.style.backgroundcolor='" + btnColorOver + "'" + chr(34) + " onmouseout=" + chr(34) + "btnMONIsave.style.backgroundcolor='" + btnColorBackground + "'" + chr(34) + " onclick='doMONI_Save()'><b><font color='#000000' size='" + CStr(fSize(-1)) + "'>SAVE</font></b></button></td>";
 sHTML = sHTML + "</tr>";
 sHTML = sHTML + "</table>";
 sHTML = sHTML + "</td></tr>"

/* HERES THE CHUNK IM HAVING AN ISSUE WITH...*/
 lidx = 0;
 for (lidx = 1; to; idxACSAcct)
  if(staACSAcct(1,lidx) > ""){
/*------------------------------------------*/

   sHTML = sHTML + "<tr>";
   sHTML = sHTML + "<td style='border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px'>";
   sHTML = sHTML + "<table border='0' width='100%' cellpadding='6' bgcolor='#CCCCCC bordercolor='CCCCCC' style='border-collapse: collapse'>";
   sHTML = sHTML + "<tr>";
   sHTML = sHTML + "<td width='30%' bgcolor='#CCCCCC' align='right'><font face='Neo Sans Intel' size='" + cstr(htaFontSize + 1) + "'>" + staACSAcct(1,lidx) + ":";
   sHTML = sHTML + "<br/>Account:&nbsp;" + staACSAcct(2,lidx);
   sHTML = sHTML + "<br/>Password:&nbsp;" + staACSAcct(3,lidx);
   sHTML = sHTML + "</font></td>";
   sHTML = sHTML + "<td bgcolor='#CCCCCC'><font face='Neo Sans Intel' size='" + cstr(htaFontSize + 2) + "' color='#FF3300'><textarea id='moni" + staACSAcct(1,lidx) + "' name='moni" + staACSAcct(1,lidx) + "' rows=1 cols=70>" + staACSAcct(4,lidx) + "</textarea></font></td>";
   sHTML = sHTML + "</tr>";
   sHTML = sHTML + "</table>";
   sHTML = sHTML + "</td>";
   sHTML = sHTML + "</tr>"

  }
 next 

 sHTML = sHTML + "</table>";
 Content.InnerHTML = sHTML;
}

Or here its extracted from above, i get the error expected ; and char 20 which is right after to.. I'm new to JavaScripting kinda but they hired me to convert there ancient VBScript to JavaScript
your not going ot be able to run this in your browser or anything for the simple fact of all hte crazy VBS fuctions that are not included here like Fsize, oh which brings me to, this is in a .HTA not HTML they would like it to be HTML as well but all get them there later after its .HTA..
Code:
for (lidx = 1; to idxACSAcct)
What is the correct expression to change it from 'to'? all i cant find on W3schools is
Code:
for (variable=startvalue;variable<=endvalue;variable=variable+increment)

and the expression
Code:
for (lidx=1 in idxACSAcct)
syntax error as well..

all help would be appriciated!!


Devon
Intel Corp. (HF)
 
btw most of that has already been converted to JS if you see a str that has an error for JS pleasse let me know

Devon
Intel Corp. (HF)
 
Code:
for (lidx=1; idxACSAcct)

supresses syntax error, not sure if it is vailid though, still have 6500+ lines of VBScript to go.. before i can actually get some output..

is the there a quick script i can insert at the top for on error output jserr to .log?

Devon
Intel Corp. (HF)
 
Try:
Code:
for(lidsx=1; lidx<=idxACSAcct; lidsx++)



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Forgot to mention a while ago that, that did indeed work, project complete :D

Devon
Intel Corp. (HF)
 
Glad I could help.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top