tcmp0.pp 483 B

1234567891011121314151617181920212223
  1. program comparechar0bug;
  2. var str1 : pchar = 'test';
  3. str2 : pchar = 'test';
  4. str3 : pchar = 'testa';
  5. str4 : pchar = 'asdf';
  6. res : longint;
  7. begin
  8. res:=CompareChar0(str1[0],str2[0],maxint);
  9. if res<>0 then
  10. halt(1);
  11. res:=CompareChar0(str1[0],str3[0],maxint);
  12. if res>=0 then
  13. halt(1);
  14. res:=CompareChar0(str4[0],str1[0],maxint);
  15. if res>=0 then
  16. halt(1);
  17. res:=CompareChar0(str1[0],str4[0],maxint);
  18. if res<=0 then
  19. halt(1);
  20. writeln('ok');
  21. end.