{
StrMove example
This example shows two functions that do the same thing as StrNew and StrDispose.
} 
uses SysUtils;
function AHeapaString(S: PChar): PChar;
{ Allocate string on heap }
 var
  L: Cardinal;
  P: PChar;
begin
 StrNew := nil;
 if (S <> nil) and (S[0] <> #0) then 
  begin
    L := StrLen(S) + 1;
    GetMem(P, L);
    StrNew := StrMove(P, S, L);
  end;
end;
procedure DisposeDaString(S: PChar);
{ Dispose string on heap }
begin
  if S <> nil then FreeMem(S, StrLen(S) + 1);
end;
var 
  S: PChar;
begin
  AHeapaString(S);
  DisposeDaString(S);
end; 
