Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Colorize source code?

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
0
0
PH
What would be the best way to colorize source code coming from the db?

Things I would like to colorize..

<%
%>
'comments
Dim
 
There are 2 good options -
1. Replace, for example, every &quot;Dim&quot; with &quot;<font color=red>Dim</font>&quot;
2. A better solution, which will prevent coloring words that are not related to the code (for instance, &quot;dim&quot; in a comment...), will be to use tags.
Here is an example -
In your DB the code will look like this:
[red]Dim a[/red] [silver]' Declaration [/silver]
On your code you will replace [red] with <font color=&quot;red&quot;>. and [/red] with </font>
And so on...

Shay

---------------
&quot;We'll never give up, it's no use&quot; (Blink 182)
 
Sorry... I didn't know that [ red ] [ / red ] was used here... :)

I hope you got the idea in spite of the red text there...
---------------
&quot;We'll never give up, it's no use&quot; (Blink 182)
 
Not sure how you would colorize code after a ' do you mean i would have to add [comment]'my comment [/comment] where there is comments etc?
 

right
---------------
&quot;We'll never give up, it's no use&quot; (Blink 182)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top