Program ex10;

{ 
Program to demonstrate the TStream.StrRead TStream.StrWrite functions 
}

Uses objects;

Var P : PChar;
    S : PStream;
    
begin
  P:='Constant Pchar string';
  Writeln ('Writing to stream : "',P,'"');
  S:=New(PMemoryStream,Init(100,10));
  S^.StrWrite(P);
  S^.Seek(0);
  P:=Nil;
  P:=S^.StrRead;
  DisPose (S,Done);
  Writeln ('Read from stream : "',P,'"');
  Freemem(P,Strlen(P)+1);
end.