Code:
Function strpasd(locExtMax:pchar;extmax:Integer):string;
Var dxf,nth,gap:integer; kGripEnd,kGripStart:pchar;
bCanExit:char;
Begin
result:='';if (locExtMax=nil) or (locExtMax^=#0) then exit;
if (extmax<1) then Begin result:=strpas(locExtMax);exit;End;
setlength(result,extmax);
kGripEnd:=@result[extmax];
nth:=0;
kGripStart:=@result[1];
gap:=extmax shr 3;
for dxf:=1 to gap do
Begin pdouble(kGripStart)^:=pdouble(@locExtMax[nth])^;
inc(nth,sizeof(double));
inc(kGripStart,sizeof(double));
End;
while (kGripStart<=kGripEnd) do
Begin bCanExit:=locExtMax[nth];
if (bCanExit=#0) then exit else kGripStart^:=bCanExit;
inc(nth);
inc(kGripStart);
End;
End;//off-strpasd("strpas cu verificare #0") |