tw28850.pp 552 B

1234567891011121314151617181920
  1. var
  2. s1, s2: ansistring;
  3. begin
  4. s1 := 'abc';
  5. s2:='';
  6. { ensure the codepage of s1 is different from defaultsystemcodepage }
  7. if defaultsystemcodepage=866 then
  8. setcodepage(rawbytestring(s1),1251,false)
  9. else
  10. setcodepage(rawbytestring(s1),866,false);
  11. { if the destination is empty, insert must create a new string
  12. with the same code page as the source }
  13. Insert(s1, s2, 1);
  14. if StringRefCount(s1)<>1 then
  15. halt(1);
  16. if StringRefCount(s2)<>1 then
  17. halt(2);
  18. if stringcodepage(s2)<>stringcodepage(s1) then
  19. halt(3);
  20. end.