Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21152

String comparison problem

$
0
0
Hi... I am trying to make a code for a html tag validation program. I am using two text files loaded to a rich text box. One for all html tags ( such as <html>,</html> etc.,) and another file is my html coding file. When i press validate button, the tags from the html tag file is stored in an array and the texts from my html coding file will be stored as a single string in a variable and i am extracting the strings from it using Instr function.
I am using the following code

For j = 0 To (i - 1)
Open File_Path For Input As #1 ' File path is my html file's location
Do Until EOF(1)
Line Input #1, Data
If InStr(1, Data, Syntax_Array(j), vbTextCompare) Then flag = 1
Loop
Close #1
If flag = 0 Then MsgBox Syntax_Array(j) + " Error"
flag = 0
Next

My code works correctly for all conditions. My syntax file has a large syntax which may or may not be used in my html code. For example, if i am not using the tag <b> and </b> in my html code but it will be present in my syntax file. For this situation my could should say nothing but it displays "<b> Error and "</b> Error>" Please help me in resolving this issue.

Viewing all articles
Browse latest Browse all 21152

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>