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!

How to include syntax highlighting in code examples.

About this forum

How to include syntax highlighting in code examples.

by  Griffyn  Posted    (Edited  )
We all appreciate our programming editor's (IDE) syntax highlighting, and so I provide a couple of tools to quickly give your forum posts that professional edge [tongue]

eg. for Delphi
Code:
[b]procedure[/b] TMyClass.Whatever([b]var[/b] Param: Integer);
[b]var[/b]
  s : [b]String[/b];
  x : Real;
[b]begin[/b]
  [b]inherited[/b];   [navy]// call TBaseClass.Whatever[/navy]
  [b]if[/b] s = [teal]'text'[/teal] [b]then[/b]
    x := [purple]0.50[/purple];
[b]end[/b];

The programs can be easily set up for any number of languages, just pop your preferred colours, formatting, and the special characters that mark comments, strings, etc. into the config.ini within.

Currently the configuration has been set up for Delphi and VB.

Download from http://users.tpg.com.au/adslwja4/BBCoder.zip

The package consists of two tools, a standalone program that you can copy plain code into and bbcode formatted code out of, as well as a Browser Helper Object that once installed will automatically provide syntax highlighting on any code samples you post. See the readme.txt file in the archive above for instructions on installing and using.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top