Mid$ anomaly in VB5
Posted on 2014-03-11
In parsing a long string of HTML code, the Mid$ function does something odd when seeing a comma.
x$= ">SMITH , JOHN <"
Mid$(x$,2,30) returns "SMITHJOHN "
If I replace the comma with a period it properly returns,
"SMITH . JOHN "
This intial position in the document is 40,000 characters from beginning. When I test on just the small snippet above, it works properly with comma in field.
Actual coding is:
pos1 = InStr(pos, HTMLtext, "<table ")
pos2 = InStr(pos1, HTMLtext, "</table>")
pos2 = pos2 + 8
CrewInfoHTML = Mid(HTMLtext, pos1, pos2 - pos1)