Applies to
Declaration
TParseEvent = procedure(Sender: TObject; StartOffset, StopOffset: Integer) of object;
property OnParse: TParseEvent;
Description
TParseEvent is the type of the OnParse event of a TPlusMemo or TDBPlusMemo. The StartOffset and StopOffset parameters indicate to the event handler the section of text that should be parsed according to your dynamic styling requirements.
The OnParse event occurs whenever the text is changed in the control; it is useful if you have some custom syntax highlighting other than keywords or sections delimited by key strings to apply with method SetDynStyle. The StartOffset and StopOffset parameters that are part of TParseEvent type indicate the range of text that should be parsed. Your application may need to take care of a larger range depending on your requirement.
You should avoid any text modification of the control while in this event. It is recommended that you restrict to text retrieval methods and and method SetDynStyle. You must be aware also that the paragraphs are not necessarily organized into lines at this stage.
Given that the logic behind syntax highlighting and usage of the OnParse event is somewhat complicated in general. Users are encouraged to use the accessory highlighting components whenever applicable.