If...Then Problem

B4X:
Sub HTML2Text(HTML As String) As String
Dim X As Long
Dim strB As String
Dim String1 As String
Dim Counter As Long
X = 1
strB = Mid(HTML, X, 1)
Do While x < HTML.Length
strB = Mid(HTML, X, 1)
If strB = "<" Then Counter = Counter + 1
If Counter = 0 Then String1 = String1 & strB
If strB = ">" Then
 If Counter <> 0 Then Counter = Counter - 1
End If
X = X + 1
Loop
Return String1
End Sub


If strB = ">" Then is missing parameters?!?!?
B4X:
If strB = ">" Then
 If Counter <> 0 Then Counter = Counter - 1
End If

How do you fix this? It fits BASIC structure perfectly.
 
not even

B4X:
If strB = ">" AND Counter <> 0 Then Counter = Counter - 1

fixes the problem...what parameter is missing when checking the simple condition strB = ">"?

and changing the > to a < or any other character fixes the problem?!?!!? can the > symbol not be used as a string?!?!
 
Last edited:
Upvote 0
If strB = Chr(62) AND Counter <> 0 Then Counter = Counter - 1


chr(62) for > fixes the problem..but that's odd the > can't be used as a string?
 
Upvote 0
Top