Board index » delphi » Searching for string in TDBMemo

Searching for string in TDBMemo

Hi All,

What would be the best (fastest) way of searching for a user-specified
substring in a TDBMemo and highlighting the text at the same time. Any
sample code would be greatly appreciated. I am using Delphi 3.00.

Thanks in advance
C. Taylor

 

Re:Searching for string in TDBMemo


Carlos Taylor heeft geschreven in bericht
<35571799.1572...@news.m.iinet.net.au>...

Quote
>Hi All,

>What would be the best (fastest) way of searching for a user-specified
>substring in a TDBMemo and highlighting the text at the same time. Any
>sample code would be greatly appreciated. I am using Delphi 3.00.

>Thanks in advance
>C. Taylor

Well, that depend on wether you can or cannot enter more than 255 chars

if you cannot do:

var s:string;
s:=tdbmemo1.text;
tdbmemo1.selstart:=pos('search_this',s);
tdbmemo1.sellength:=length('search_this');
tdbmemo1.text:=s;

else try it with nullterminated-string functions

I believe that is something with gettext...

Maus

Other Threads