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

  1. Program ex10;
  2.  
  3. Program to demonstrate the TStream.StrRead TStream.StrWrite functions 
  4. }
  5.  
  6. Uses objects;
  7.  
  8. Var P : PChar;
  9.     S : PStream;
  10.     
  11. begin
  12.   P:='Constant Pchar string';
  13.   Writeln ('Writing to stream : "',P,'"');
  14.   S:=New(PMemoryStream,Init(100,10));
  15.   S^.StrWrite(P);
  16.   S^.Seek(0);
  17.   P:=Nil;
  18.   P:=S^.StrRead;
  19.   DisPose (S,Done);
  20.   Writeln ('Read from stream : "',P,'"');
  21.   Freemem(P,Strlen(P)+1);
  22. end.