trichview.com

trichview.support




Re: TRichView Words


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/10/2002 16:59:20


You can

1) Save text to TStringStream (RichView.SaveTextToStream) and read words

from Stream.DataString (of from stream itself)

2) Enumerate all items in RichView, and get all words from separate items.

Here is a procedure for enumeration (it converts all text to upper case, but

it's not hard to modify for your task):


uses CRVData;


procedure AllUpperCase(RVData: TCustomRVData);

var i,r,c: Integer;

     table: TRVTableItemInfo;

begin

for i := 0 to RVData.Items.Count-1 do

  if RVData.GetItemStyle(i)>=0 then begin // this is a text item

    s := RVData.Items[i];

    s := AnsiUpperCase(s); // WARNING: will not work with Unicode

    RVData.Items[i] := s;

    end

  else if RVData.GetItemStyle(i)=rvsTable then begin

    table := TRVTableItemInfo(RVData.GetItem(i));

    for r := 0 to table.Rows.Count-1 do

      for c := 0 to table.Rows[r].Count-1 do

        if table.Cells[r,c]<>nil then

          AllUpperCase(table.Cells[r,c].GetRVData);

  end;

end;


call

AllUpperCase(RichView.RVData);





>

> I wanna get all words from TRichedit

>

> what do you advice me to do ?





Powered by ABC Amber Outlook Express Converter