Thema: Delphi StrLCopy : Non VCL

Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#11

AW: StrLCopy : Non VCL

  Alt 28. Apr 2012, 01:23
Delphi-Quellcode:
function StrLCopy(Dest, Source: PChar; MaxLen: Cardinal): PChar;
var
  Count: Cardinal;
begin
  // copies a specified maximum number of characters from Source to Dest
  Result := Dest;
  Count := 0;
  While (Count < MaxLen) and (Source^ <> #0) do begin
    Dest^ := Source^;
    Inc(Source);
    Inc(Dest);
    Inc(Count);
  end;
  Dest^ := #0;
end;
  Mit Zitat antworten Zitat