paix144
15-01-2010, 02:04 PM
السلام عليكم
procedure AnimatedWrite(aStr: string; aStrings: TStrings; const aIndex: LongInt=-1; const aSpeed: LongWord=80; aStopPtr: PBoolean=nil);
var
N, IDX : LongInt;
S : String;
begin
if aIndex = -1 then
Idx := aStrings.Add('')
else
Idx := aIndex;
for N := 1 to length(aStr) do
begin
S := Copy(aStr, 1, N);
aStrings[idx] := S + '.';
Application.ProcessMessages;
Sleep(aSpeed);
aStrings[idx] := S;
if aStopPtr <> nil then
if aStopPtr^ then
begin
aStrings[idx] := aStr;
exit;
end;
end;
end;
procedure AnimatedWrite(aStr: string; aStrings: TStrings; const aIndex: LongInt=-1; const aSpeed: LongWord=80; aStopPtr: PBoolean=nil);
var
N, IDX : LongInt;
S : String;
begin
if aIndex = -1 then
Idx := aStrings.Add('')
else
Idx := aIndex;
for N := 1 to length(aStr) do
begin
S := Copy(aStr, 1, N);
aStrings[idx] := S + '.';
Application.ProcessMessages;
Sleep(aSpeed);
aStrings[idx] := S;
if aStopPtr <> nil then
if aStopPtr^ then
begin
aStrings[idx] := aStr;
exit;
end;
end;
end;