tcpstrconcat.pp 638 B

123456789101112131415161718192021222324252627282930313233343536
  1. {$APPTYPE CONSOLE}
  2. uses
  3. {$ifdef unix}
  4. cwstring,
  5. {$endif unix}
  6. SysUtils;
  7. type
  8. ts866 = type string<866>;
  9. var
  10. a, b, c : ts866;
  11. begin
  12. a := 'al';
  13. b := 'b2';
  14. c := '';
  15. //without "DestS" in the array
  16. c := a + b;
  17. if (StringCodePage(c) <> 866) then
  18. halt(1);
  19. //with empty "DestS" in the array
  20. c := '';
  21. c := c + a ;
  22. if (StringCodePage(c) <> 866) then
  23. halt(2);
  24. //with "DestS" in the array at the start
  25. c := c + a ;
  26. if (StringCodePage(c) <> 866) then
  27. halt(3);
  28. //with "DestS" in the array, not at the start
  29. c := a + c;
  30. if (StringCodePage(c) <> 866) then
  31. halt(4);
  32. WriteLn('ok');
  33. end.