VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



HTML Tag Parser - Parses out the tags from source code and places them in a listbox.

by Twiggy (1 Submission)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 30th August 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

HTML Tag Parser - Parses out the tags from source code and places them in a listbox.

API Declarations


1 Command Button (Command1)
2 Timers (Timer1,Timer2, Both Set bEnabled = False,Intervals 1)
1 Textbox (Text1, Set to Multiline = True, Vertical Scroll Bars)
1 Listbox (List1)

Rate HTML Tag Parser - Parses out the tags from source code and places them in a listbox.



'And Yes I Tried With Loops And They Dont Work As Good

' Just Declare Some Variables Just To Be Sure
Dim n As Integer
Dim p As Integer
Dim z As Integer
Dim a As String
Dim b As String

'When You Click The Button You Start Timer 1
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

'Scans Each Character Till It Hits < Then Switches To Timer2
Private Sub Timer1_Timer()
p = p + 1
a = Mid$(Text1, p, 1)
If a = "<" Then
Timer2.Enabled = True
Timer1.Enabled = False
z = p
End If
End Sub

Private Sub Timer2_Timer()
'Records Lengths And Scans For > Then Parses It Out And Throws It In The Listbox
'Then Moves Onto The Next < And So On
c = Mid$(Text1, p, 1)
p = p + 1
n = n + 1
If c = ">" Then
b = Mid$(Text1, z, n)
List1.AddItem b
Timer2.Enabled = False
z = 0
n = 0
a = ""
c = ""
Timer1.Enabled = True
End If
End Sub


Download this snippet    Add to My Saved Code

HTML Tag Parser - Parses out the tags from source code and places them in a listbox. Comments

No comments have been posted about HTML Tag Parser - Parses out the tags from source code and places them in a listbox.. Why not be the first to post a comment about HTML Tag Parser - Parses out the tags from source code and places them in a listbox..

Post your comment

Subject:
Message:
0/1000 characters