Page 1 of 1

How can I tell if a text item has been modified

Posted: Fri Mar 18, 2011 12:29 am
by phorst
In my application, I load multiple paragraphs of text to TRichViewIedit component using AddTextNL.

Upon saving the contents of the editor, I write the text to various records in the database depending on the content. I want to know if each text item is changed or not in order to set a date changed field for that particular database record (only when it really changes).

I know I can test if any text is modified in the Editor, but is there way to test if each text item was modified (or not) without saving the original text somewhere for comparison? That is, is the a property of a text item which indicates it was modified?

Thanks,
Phil

Posted: Fri Mar 18, 2011 8:36 pm
by Sergey Tkachenko
When a text item is edited, OnItemTextEdit event occurs.

See also the demo in Demos\*\Assorted\Fields\LiveLink\Tables\
It establishes a link between a text item and TEdit
(however, this demo does not use OnItemTextEdit event, it rescans the whole document on each change)

Posted: Sat Mar 19, 2011 3:53 pm
by phorst
Thanks for your reply. This will work.