TFindDialog Code Problem - What am I doing wrong?
Hello,
I am having trouble with the following code. It is suppose to find text in a
TMemo (Editor). It is executed when the user clicks "Find" in TFindDialog.
(Where "Editor" is a TMemo, and "Find" is a TFindDialog). I know it is
probably something really obvious, but I a truely stumpped! Please help!
-----------------------------------------------
int i, j, PosReturn, SkipChars;
for(i=0; i<Editor->Lines->Count; i++) {
PosReturn = Editor->Lines->Strings[i].Pos(Find->FindText);
if(PosReturn == 0) {
SkipChars = 0;
for(j=0; j<i-1; j++) {
SkipChars = SkipChars + Editor->Lines->Strings[j].Length();
}
SkipChars = SkipChars + (i*2);
SkipChars = SkipChars + PosReturn - 1;
Editor->SetFocus();
Editor->SelStart = SkipChars;
Editor->SelLength = Find->FindText.Length();
}
}
------------------------------------------
Also, this may be the wrong News Group to post to with this question, but
borland.public.cppbuilder.vcl seems to be down.
Thank you in advance,
Aaron Bockover