PDA

View Full Version : Highlighted Syntax


mr_ego
08-27-2002, 02:16 AM
I need an ASP script that highlights the syntax of another ASP script that has been opened by the first ASP script.

If anyone can help -- Thanks

whammy
08-29-2002, 01:15 AM
??? I'm not sure at all what you mean (and apparently noone else is either, or they probably would have responded!).

Could you perhaps explain in a LOT more detail what you are trying to accomplish?

mr_ego
08-29-2002, 09:26 AM
when using this message board there is a PHP button that highlights commands in a php script that you write in the text box.

I need a ASP script that opens ANOTHER script and HIGHLIGHTS the commands, values and other information as such on a website (before the 1st of september)

The script would return something similar to this:


<?
echo "<html>\n";
?>


thanks. :thumbsup:

mr_ego
08-31-2002, 05:36 AM
URGENT

I NEED THIS BY THE 1st OF SEPTEMBER

thanks for those who help!

whammy
09-01-2002, 02:49 AM
I haven't tried anything like this - you might want to check out HTML KIT or some other editors like Edit Pad that color syntax and figure out how they did it - or check out http://www.hotscripts.com - or maybe do a search on google for "colored syntax".

I wish I could help more, but it's probably just a set of regular expressions that you need to figure out.

firepages
09-01-2002, 01:30 PM
the PHP code highlighting used on this board uses the PHP function show_source()/highlight_string() - PHP can also highlight complete files if configured to do so by giving them the extension .phps

as whammy suggests you need to pass your code via some regular expressions to find the ASP keywords (and/or VB/PERL/C#) and add simple HTML formatting to them, you would also need a function similar to PHP's htmlspecialchars() to display the code correctly in the browser.

whammy
09-01-2002, 08:23 PM
Or in ASP = Server.HTMLEncode(string)

P.S. I just whipped this up in a second but it might help:

(<%).*(%>)

That is a greedy regular expression that matches two asp delimiters with anything in between them.

This link might help:

http://www.2enetworx.com/dev/live/hiliter/src.asp