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

  1. Program ex13;
  2.  
  3. Program to demonstrate the TStream.ReadStr TStream.WriteStr functions 
  4. }
  5.  
  6. Uses objects;
  7.  
  8. Var P : PString;
  9.     L : String;
  10.     S : PStream;
  11.     
  12. begin
  13.   L:='Constant string line';
  14.   Writeln ('Writing to stream : "',L,'"');
  15.   S:=New(PMemoryStream,Init(100,10));
  16.   S^.WriteStr(@L);
  17.   S^.Seek(0);
  18.   P:=S^.ReadStr;
  19.   L:=P^;
  20.   DisposeStr(P);
  21.   DisPose (S,Done);
  22.   Writeln ('Read from stream : "',L,'"');
  23. end.