Mars base one Username: Jim Davis Password: yCrm33
Posts
1,284
HTML document tool
Hello!
No api calls today, but pure vb6. This tool "parses" html tags, then display them in a frame, you can edit their values one by one in a textbox. It also got some funky feature, you may find useful if you have to work with html documents.
Undercommented, not-so-well organized, but works just like it should. And its pure vb ^^
Ive done it in a couple of hours, but it was just 'nuff But, i'm still thinking on some better ways to do parsing html.
Anyway, have fun!
Note:
If you want to use this method in your code, to process html documents, you can simply replace the text1.selstart property, to a private or public variable, that is just used to store the string pointer.
Last edited by Jim Davis; Nov 30th, 2008 at 04:40 PM.
Reason: update 1
Mars base one Username: Jim Davis Password: yCrm33
Posts
1,284
Re: HTML document tool
You can use the algorithm of the Forward button, that will walk thru on each tags. But, it will skip <script> and <style> tags! That means, a <script src=".."> will not be replaced. Its better to replace the code that does the skip, also comment out the <style> things.
For example, this will look for all <!-- --> tags and skip their content. These are the standards that used inside the <script and <style tags, to comment out the content, but the content will be interpreted by the browser, just wont show them.
vb Code:
'in Private Sub cmdForward_Click() ...
If InStr(1, LCase(Mid$(sHTMLDocument, Text1.SelStart, lSelLength)), "<!--", vbTextCompare) > 0 Then
After this modification, you can use the algo to walk thru the tags, that there you can execute the replacement for each src (cmdAuto2) and href (cmdAuto3) properties.
You can also try to combine the algos of cmdAuto2 and cmdAuto3.
Last edited by Jim Davis; Nov 26th, 2008 at 02:12 PM.