trichview.support
AllUpercase procedure |
Author |
Message |
Alexander Adam |
Posted: 08/15/2002 20:37:00 hi! I got it all running to replace my "variables" with your given AllUpercase procedure but have still one big problem: I need to delete the old item after used "InsertString" to insert two new items. I can set RVData.Items[i] := ''; but that only sets empty text, the item still exists. So I tried to to call RVData.DeleteItems(i, 1); before I use InsertString() but that doesn't work. See my (pseudo-code) I use for this and tell me what am I doing wrong here? for i := 0 to RVData.Items.Count-1 do begin x := RVData.GetItemStyle(i); if x>=0 then begin // this is a text item s := RVData.Items[i]; if LowerCase(trim(S)) = '[#MYVAR#]' then begin RVData.Items[i] := ''; if Trim(Item.Themes) = '' then begin // end else begin Offs := RVD.GetOffsBeforeItem(i); RVD.SetSelectionBounds(i,Offs,i,Offs); Buffer := RVD.CurTextStyleNo; try Str := TStringList.Create; Str.Text := Item.Themes; for k:=0 to Str.Count-1 do begin try RVD.InsertString('TEST'); if k < Str.count-1 then begin RVD.ApplyTextStyle(0); RVD.InsertText(#32 + '|' + #32); RVD.ApplyTextStyle(Buffer); end; except // end; end; finally if Assigned(Str) then Str.Free; end; // Rvd.DeleteItems(i + k + 1, 1); // end; end; end else if x=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 ReplaceSeeAlso(table.Cells[r,c].GetRVData); end; end; thanks, Alex |
Powered by ABC Amber Outlook Express Converter