I'm working on a vbscript program and I have got and "Expected Statement" Error. I cannot find the error. I've seen some samples of this error but they didn't help me.
I am new to vbscript.
Here is the code.
Sub SetText(tx, lw)
Dim t, l, r, a
t = -1
l = Len(tx)
r = ""
a = 0
While t < l
t = t + 1
a = Asc(Mid(tx,t,1))
If a >= 160 or a=60 or a=62 or a=38 or a=34 or a=39 or a=32 Then
If a = 32 Then
r = r + " "
Else
r = r + "&#" + Cstr(a) + ";"
End If
Else
r = r + Mid(tx,t,1)
End If
End While 'The error occurs at the beginning of this statement.'
If Not lw Then
r = "<pre>" + r + "</pre>"
End If
r = "<div style='width:auto; height:auto;'>" + r + "</div>"
objExplorer.document.body.innerHTML = r
End Sub