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

  1. Program Example9;
  2.  
  3. Uses strings;
  4.  
  5. { Program to demonstrate the StrIComp function. }
  6.  
  7. Const P1 : PCHAR = 'This is a pchar string.';
  8.       P2 : PCHAR = 'This is a PCHAR string.';
  9.       P3 : PCHAR = 'tHiS iS aLsO a PCHAR string';
  10.       p4 : pchar = 'AAbcd';
  11.       p5 : pchar = 'AEbcd';
  12.        
  13. Var L : Longint;       
  14.        
  15. begin
  16.   If StrIComp (P1,P2)<>0 then writeln ('Something wrong here !');
  17.   Write ('P2 and P3 match in their first ');
  18.   L:=1;
  19.   While StrLIComp (P2,P3,L)=0 do inc(L);
  20.   Dec(L);
  21.   Writeln (L,' characters, case insensitive.');
  22.   if strIcomp(p4,p5)=0 then writeln ('This can''t happen!');
  23. end.
  24.