trichview.support
export table as txt-file |
Author |
Message |
jb |
Posted: 03/13/2005 11:41:47 Hello Sergey, many thanks for your help. Your code (table to txt-file) doesn't work correct. It produces the error ('Listenindex �berschreitet das Maximum (0)'). Your mailbox returns my eMail (to you) back to sender (since a week). What is wrong ? procedure TForm1.Tab2TxtSpeiClick(Sender: TObject); var item: TCustomRVItemInfo; rveTable: TRVTableItemInfo; rve: TCustomRichViewEdit; RVData: TCustomRVData; ziel: textFile; r,c,i: integer; begin if not memo.GetCurrentItemEx(TRVTableItemInfo, rve, item) then begin showMessage('Die Tabelle hat nicht den Focus !'); exit; end; rveTable := TRVTableItemInfo(item); try assignfile(ziel, '123.txt'); rewrite(ziel); for r := 0 to rveTable.Rows.Count-1 do begin
for c := 0 to rveTable.Rows[r].Count-1 do begin if rveTable.Cells[r,c]<>nil then begin RVData := rveTable.Cells[r,c].GetRVData; for i := 0 to RVData.ItemCount-1 do begin if RVData.GetItemStyle(i)>=0 then write(ziel, rveTable.Cells[r,c].getItemTextA(i)) else if RVData.GetItemStyle(i)=rvsTab then write(ziel, #9); end; if c+rveTable.Cells[r,c].ColSpan<>rveTable.Rows[r].Count then write(ziel, ';'); end; // if rveTable. end; // c := 0 to
if r<>rveTable.Rows.Count-1 then writeln(ziel); end; // r := 0 to finally closeFile(ziel); end; end; |
Powered by ABC Amber Outlook Express Converter