trichview.com

trichview.support




Re: processing cell data


Return to index


Author

Message

Sergey Tkachenko

Posted: 09/05/2002 15:19:03


This procedure shows how to enumerate all items, include items in cells.

It converts all text uppercase:


procedure AllUpperCase(RVData: TCustomFormattedRVData);

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 it as:


AllUpperCase(RichView.RVData);



>

> hi all

> iam trying to read information from an RTF file this file is orgnized as

> a x by y table

> i need to know what type of object in each cell and how many items

> there is an example within the demo but it does not cover the table

> thanks





Powered by ABC Amber Outlook Express Converter