VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

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

Martijn B  (7 Submissions)   String Manipulation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

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

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 (4(4 Vote))
Fast Colorize 2 for HTML / XML / XHTML / SGML / ... source viewing.bas

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

No comments yet — be the first to post one!

Post a Comment

0/1000 characters