首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > vbScript >

语句未结束 到底错哪了

2012-02-13 
语句未结束 到底哪里错了?scriptlanguagevbscriptdim c0 FunctionGetBytes2BSTR(p_sHtmlStr)dimsRetu

语句未结束 到底哪里错了?
<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 

热点排行