tcpstransistrcompare.pp 510 B

1234567891011121314151617181920212223242526272829303132
  1. uses
  2. {$ifdef unix}
  3. {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
  4. {$endif unix}
  5. SysUtils;
  6. type
  7. ts1253 = type AnsiString(1253);
  8. ts1251 = type AnsiString(1251);
  9. var
  10. s1 : ts1253;
  11. s2 : ts1251;
  12. au : unicodestring;
  13. begin
  14. au := #$20AC; // Euro symbol
  15. s1 := au;
  16. s2 := au;
  17. if Ord(s1[1]) = Ord(s2[1]) then
  18. halt(5);
  19. if (s1>s2) then
  20. halt(1);
  21. if (s1<s2) then
  22. halt(2);
  23. s1 := s1 + 'a';
  24. if (s1<=s2) then
  25. halt(3);
  26. if (s2>=s1) then
  27. halt(4);
  28. writeln('ok');
  29. end.