mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 18:51:53 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			412 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			412 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| 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. | 
