mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 18:51:53 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			398 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			398 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program ex40;
 | |
| 
 | |
| { Program to demonstrate the NewStr function }
 | |
| 
 | |
| Uses Objects;
 | |
| 
 | |
| Var S : String;
 | |
|     P : PString;
 | |
| 
 | |
| begin
 | |
|   S:='Some really cute string';
 | |
|   Writeln ('Memavail : ',Memavail);
 | |
|   P:=NewStr(S);
 | |
|   If P^<>S then 
 | |
|     Writeln ('Oh-oh... Something is wrong !!');
 | |
|   Writeln ('Allocated string. Memavail : ',Memavail);
 | |
|   DisposeStr(P);
 | |
|   Writeln ('Deallocated string. Memavail : ',Memavail);
 | |
| end. | 
