当前位置: 代码迷 >> vbScript >> 语句未结束 到底错哪了
  详细解决方案

语句未结束 到底错哪了

热度:4824   发布时间:2013-02-26 00:00:00.0
语句未结束 到底哪里错了?
<script language=vbscript> 
dim c=0 ;
  Function GetBytes2BSTR(p_sHtmlStr)  
  dim sReturnStr ;
  dim i,n ;  
  sReturnStr = ""  
  n = LenB(p_sHtmlStr) ;  
   
  For i = 1 To n ;
  dim sCharCode ;
  dim sNextCharCode ;
   
  sCharCode = AscB( MidB(p_sHtmlStr, i, 1) ) ; 
   
  If (sCharCode < &H80) Then  
  sReturnStr = sReturnStr & Chr(sCharCode)  
  Else  
  sNextCharCode = AscB( MidB(p_sHtmlStr, i+1, 1) )  
  sReturnStr = sReturnStr & Chr(CLng(sCharCode) * &H100 + CInt(sNextCharCode))  
  i = i + 1  
  End If  
  Next  
   
  GetBytes2BSTR = sReturnStr ;
  End Function  
   
  Function getData(strUrl)  
  Dim xmlhttp  
  Set xmlhttp=CreateObject("Microsoft.XMLHTTP")  
  xmlhttp.open "get",strUrl,false  
  xmlhttp.send  
   
  getData=GetBytes2BSTR(xmlhttp.responseBody)  
   
  End Function  
   
  Function test(url)  
  alert url
  Dim strurl,strHTML,oTables,oTable  
  strHTML=getData(url) 
  If(c==0) Then
  getLrc.hid= strHTML
  c++
  check()
  Else 
  lrcbox.innerHTML=strHTML  
 End If  
  Next  
  End Function  
  Function here(s)
alert s
End Function  
  </script>
第一次用vb
运行时报错:语句未结束!
到底哪里未结束啊!高手指点

------解决方案--------------------------------------------------------
VBScript code
Dim c : c = 0Function  GetBytes2BSTR(p_sHtmlStr)    dim  sReturnStr   dim  i,n  sReturnStr  =  ""  n = LenB(p_sHtmlStr)  dim sCharCode  dim sNextCharCode  For i = 1 To n    sCharCode  =  AscB(MidB(p_sHtmlStr, i, 1))    If  (sCharCode < &H80)  Then        sReturnStr = sReturnStr & Chr(sCharCode)    Else        sNextCharCode =  AscB(MidB(p_sHtmlStr, i+1, 1))        sReturnStr =  sReturnStr & Chr(CLng(sCharCode) * &H100 + CInt(sNextCharCode))        i  =  i  +  1    End If  Next  GetBytes2BSTR  =  sReturnStrEnd  FunctionFunction getData(strUrl)    Dim  xmlhttp    Set  xmlhttp = CreateObject("Microsoft.XMLHTTP")    xmlhttp.open "get",strUrl,false    xmlhttp.send  getData=GetBytes2BSTR(xmlhttp.responseBody)  End  Function  Function test(url)    Dim  strurl,strHTML,oTables,oTable    strHTML = getData(url)   If c = 0 Then    'getLrc.hid = strHTML     c = c + 1     check   Else     lrcbox.innerHTML = strHTML    End  IfEnd  Function  Function here(s)    MsgBox sEnd  Function
  相关解决方案