home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / objectex / ex40.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  398 b   |  19 lines

  1. Program ex40;
  2.  
  3. { Program to demonstrate the NewStr function }
  4.  
  5. Uses Objects;
  6.  
  7. Var S : String;
  8.     P : PString;
  9.  
  10. begin
  11.   S:='Some really cute string';
  12.   Writeln ('Memavail : ',Memavail);
  13.   P:=NewStr(S);
  14.   If P^<>S then 
  15.     Writeln ('Oh-oh... Something is wrong !!');
  16.   Writeln ('Allocated string. Memavail : ',Memavail);
  17.   DisposeStr(P);
  18.   Writeln ('Deallocated string. Memavail : ',Memavail);
  19. end.