tsetstring.pp 569 B

1234567891011121314151617181920212223242526272829303132
  1. program tsetstring;
  2. type
  3. tstr866 = type ansistring(866);
  4. var
  5. str866: tstr866;
  6. a: ansistring;
  7. u: unicodestring;
  8. s: shortstring;
  9. pa: pansichar;
  10. begin
  11. setstring(str866,'abcdef',5);
  12. if stringcodepage(str866)<>866 then
  13. halt(1);
  14. if str866<>'abcde' then
  15. halt(2);
  16. setstring(a,'abc',3);
  17. if (stringcodepage(a)<>0) and
  18. (stringcodepage(a)<>DefaultSystemCodePage) then
  19. halt(3);
  20. if a<>'abc' then
  21. halt(4);
  22. pa:='12345';
  23. setstring(u,pa,5);
  24. if u<>'12345' then
  25. halt(5);
  26. setstring(s,pa,5);
  27. if s<>'12345' then
  28. halt(7);
  29. end.