mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 09:11:53 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			418 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			418 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example8;
 | |
| 
 | |
| Uses strings;
 | |
| 
 | |
| { Program to demonstrate the StrLComp function. }
 | |
| 
 | |
| Const P1 : PChar = 'This is the first string.';
 | |
|       P2 : PCHar = 'This is the second string.';
 | |
| 
 | |
| Var L : Longint; 
 | |
| 
 | |
| begin
 | |
|   Write ('P1 and P2 are ');
 | |
|   If StrComp (P1,P2)<>0 then write ('NOT ');
 | |
|   write ('equal. The first ');
 | |
|   L:=1;
 | |
|   While StrLComp(P1,P2,L)=0 do inc (L);
 | |
|   dec(l);
 | |
|   Writeln (l,' characters are the same.');
 | |
| end.
 | 
