Syntax Highlighting

<< Click to Display Table of Contents >>

Navigation:  Programming >

Syntax Highlighting

 

Syntax highlighting is useful to avoid logical errors when the user is supposed to edit XML or HTML text in ANSI form or when she or he is editing programming code.

 

WPTools 5 includes the class TWPSynEditHighlight which is used as interface to the syntax highlighters included in the open source project SynEdit. Since character attributes, such as "bold" and text color are permanently assigned to the text, it is not possible to deliberately choose text attributes for the text.

 

WPTools 8 includes a new special syntax highlighting component which dynamically highlights the parts of the text which are detected to be "tokens". It is still possible to apply text attributes.  

 

Currently a syntax highlighter for XML and the special reporting and mail merge tokens are available.

 

Syntax highlighers can apply character attributes to the text, or, and this is unique, work non destructive. Here the character attribute is calculated "on the fly", depending on the context.