unit OOTable;
interface
uses Classes, Contnrs, ooObject, Variants;
type
TOOTable=class(TObject)
private
FvTable: Variant;
protected
property vTable:Variant read FvTable;
public
constructor create(AvTable:Variant); reintroduce;
procedure pInitialize(AiRows, AiCells:Integer);
procedure pSetTableValues(AoStringList:TStringList);
end;
implementation
uses SysUtils;
{ TOOTable }
constructor TOOTable.create(AvTable:Variant);
begin
FvTable:=AvTable;
end;
procedure TOOTable.pInitialize(AiRows, AiCells: Integer);
begin
if NOT VarIsEmpty(vTable) then begin
vTable.initialize(AiRows,AiCells);
end;
end;
procedure TOOTable.pSetTableValues(AoStringList: TStringList);
var iIndex:Integer;
vCell:OleVariant;
aCellName, aCellValue:String;
begin
if NOT VarIsEmpty(vTable) then begin
for iIndex := 0 to AoStringList.Count - 1 do begin
aCellName:=AoStringList.Names[iIndex];
aCellValue:=AoStringList.ValueFromIndex[iIndex];
vTable.getCellByName(aCellName).SetString(aCellValue);
end;
end;
end;
end.