procedure TprintForm.autochangerow(const wide:Integer;var value:string);
var
temparr:array of string;
widelen,i,j:integer;
s:widestring;
begin
j:=1;
s:=value;
widelen:=length(s);
setlength(temparr,j);
temparr[0]:='';
for i:=1 to widelendo
begin
if length(temparr[j-1])+length(s)>wide then
begin
j:=j+1;
setlength(temparr,j);
temparr[j-1]:=s;
end
else
begin
temparr[j-1]:=temparr[j-1]+s;
end;
end;
s:='';
for i:=0 to length(temparr)-2do
s:=s+temparr+chr(13);
value:=s+temparr[length(temparr)-1];
temparr:=nil;
end;