2
0

ex8.pp 418 B

1234567891011121314151617181920
  1. Program Example8;
  2. Uses strings;
  3. { Program to demonstrate the StrLComp function. }
  4. Const P1 : PChar = 'This is the first string.';
  5. P2 : PCHar = 'This is the second string.';
  6. Var L : Longint;
  7. begin
  8. Write ('P1 and P2 are ');
  9. If StrComp (P1,P2)<>0 then write ('NOT ');
  10. write ('equal. The first ');
  11. L:=1;
  12. While StrLComp(P1,P2,L)=0 do inc (L);
  13. dec(l);
  14. Writeln (l,' characters are the same.');
  15. end.