VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing

by Martijn B (7 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

This function accepts a text-file as input and will output a colorized RTF String.
Nothing new about that, but this program will generate even large RTF files very fast.
You will see the difference if you try to colorize a 500kb XML file.
You may add the modules to your code to add HTML/XML/XHTML source viewing capabilities.
The code has gotten quite complicated, but the adjustable parts are documented.
(changing colors, or the tags that need coloring). You can for example color all
tags red.
This is version 2. 2001-11-24
Changes:
[-] Twice as fast. (500kb/s. on PIII450)
[-] Added a cAppendString class instead of using Mid$.
[-] Fast string space allocation by API calls. String pointer swapping. (Thanks to VBSpeed)
[-] Now uses Regular Expressions to color the 'inside' of tags (THANKS to Gary aka RegX for the idea to use REGULAR EXPRESSIONS. You can download similar projects from RegX here on VBCODE)
[-] Added a RTE control to speed up viewing.
CREDITS AND COPYRIGHT:
MartijnB ([email protected])
Money, rewards, bugs and .. can be send to me (please!)
SEE README.TXT

Inputs
This function accepts a text-file as input and will output a colorized RTF file as String.
Assumes
Asumes availability of the MS VBScript Regular Expressions 5.5
Code Returns
A single string.
API Declarations
Few API calls for string allocation are used.
All calls may be replaced by a (slower) single VB statement.

Rate Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing

Upload

Download this snippet    Add to My Saved Code

Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing Comments

No comments have been posted about Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing. Why not be the first to post a comment about Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing.

Post your comment

Subject:
Message:
0/1000 characters