fpc/docs/objectex/ex40.pp
1999-01-17 15:08:43 +00:00

19 lines
398 B
ObjectPascal

Program ex40;
{ Program to demonstrate the NewStr function }
Uses Objects;
Var S : String;
P : PString;
begin
S:='Some really cute string';
Writeln ('Memavail : ',Memavail);
P:=NewStr(S);
If P^<>S then
Writeln ('Oh-oh... Something is wrong !!');
Writeln ('Allocated string. Memavail : ',Memavail);
DisposeStr(P);
Writeln ('Deallocated string. Memavail : ',Memavail);
end.