You could also load it into an invisible richTExt component and use the it's properties.. (hey, it IS called RAD you know :-).
DJS --- "Glenn B. Lawler" <[EMAIL PROTECTED]> wrote: > > does anyone know an algorithm for extracting the > display text from a RTF > > formatted text? I want to search in a database > blob field containing the > > RTF memo entered by the user. To deliver correct > results I need to search > > only the display text and exclude the format > strings. > > Load an RTF document into a standard text editor, > like Notepad and take a > look. Generally, RTF uses { and } in the same way > that HTML uses < and >. > There are escape sequences used in RTF to represent > reserved characters, > just as HTML uses > < and other "named > entities". All you need to do > to translate to plain text is read the RTF stream > one character at a time, > keep track of the state you are in, skip the RTF > control strings and output > everything that is not a control string after > unescaping the control > sequences. > > An easy way to test your algorithm is to create a > test document containing > all the ASCII characters in Word, save as an RTF, > then convert to text with > your program. If it does not match, you will be able > to isolate the character > which caused your algorithm to fall of the tracks. > > Glenn Lawler > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/i7folB/TM --------------------------------------------------------------------~-> ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/