Fórum COMO JUSTIFICAR UM RICHEDIT NO DELPHI? #148899
23/03/2003
0
COMO JUSTIFICAR UM RICHEDIT NO DELPHI?
Anonymous
Curtir tópico
+ 0
Responder
Posts
23/03/2003
Carnette
COMO JUSTIFICAR UM RICHEDIT NO DELPHI?
http://clubedelphi.videomart.com.br/viewtopic.php?t=6598
Responder
Gostei + 0
24/03/2003
Dor_poa
var
mPos,mPont,mTam,mNr,mCont:integer;
mStr:string;
begin
mTam:=Length(mCad);
if mTam>=mMax then
Result:=copy(mCad,1,mMax)
else
mStr:=´´;
mCont:=0;
mPont:=1;
mNr:=mMax-mTam;
while mCont<mNr do
begin
mPos:=pos(mStr,copy(mCad,mPont,100));
if mPos=0 then
begin
mStr:=mStr+´ ´;
mPont:=1;
continue;
end
else
begin
mCont:=mCont+1;
Insert(´ ´,mCad,mPos+mPont);
mPont:=mPont+mPos+length(mStr);
end;
Result:=mCad;
end;
end;
EX.:
Memo1.lines[i]:=(justifica(memo1.lines[i],60 {Nº de caracteres possiveis da linha});
mPos,mPont,mTam,mNr,mCont:integer;
mStr:string;
begin
mTam:=Length(mCad);
if mTam>=mMax then
Result:=copy(mCad,1,mMax)
else
mStr:=´´;
mCont:=0;
mPont:=1;
mNr:=mMax-mTam;
while mCont<mNr do
begin
mPos:=pos(mStr,copy(mCad,mPont,100));
if mPos=0 then
begin
mStr:=mStr+´ ´;
mPont:=1;
continue;
end
else
begin
mCont:=mCont+1;
Insert(´ ´,mCad,mPos+mPont);
mPont:=mPont+mPos+length(mStr);
end;
Result:=mCad;
end;
end;
EX.:
Memo1.lines[i]:=(justifica(memo1.lines[i],60 {Nº de caracteres possiveis da linha});
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)