mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 07:29:26 +02:00
19 lines
398 B
ObjectPascal
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. |