type tprint=class
private
fhead:integer;ColItem:array of string
;
published
property lineheight:integer read flineheight write setlineheight;
property head:integer read fhead write sethead;
property lx:string read flx write setlx;
property ColCount:integer read fcolcount write setcolcount;
property colName:string read fcolname write setcolname;
property ColItems:string read Fcolitems write setColItems;
^^^^^^^^^^^^
end;
implementation
{ tprint }uses printers;
function tprint.GetColItems(inti: integer): string;
var
intM,intN,intJ:integer;
begin
//get start position
if inti=1 then
intm:=0
else
begin
intm:=pos(',',fcolitems);
fcolitems[intm]:='.';
end;
//get end position
intn:=pos(',',fcolitems);
//return column name
if intn<>0 then
result:=copy(fcolitems,intm+1,intn-intm-1)
else
result:=copy(fcolitems,intm+1,length(fcolitems)-intm);
end;
function tprint.getcolname(i: integer): string;
var
intn,intm:integer;
begin
if i=1 then
intm:=0
else begin
intm:=pos(',',fcolname);
fcolname[intm]:='.';
end;
intn:=pos(',',fcolname);
if intn<>0 then
result:=copy(fcolname,intm+1,intn-intm-1)
else result:=copy(fcolname,intm+1,length(fcolname)-intm);
end;
有点乱了。。