ex9.pp 613 B

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