fpc/tests/test/tcpstrassignansistr.pp
paul 8b0cb2c1d5 compiler:
- don't parse '(' token after the type declaration inside the type block
  - replace parse of "string<codepage>" to "type AnsiString(codepage)" for delphi compatibility
  - fix tests to use "type AnsiString(codepage)"

git-svn-id: trunk@19148 -
2011-09-19 04:11:57 +00:00

30 lines
538 B
ObjectPascal

{$CODEPAGE cp866}
program tcpstrassignansistr;
type
ts866 = type AnsiString(866);
procedure doerror(ANumber : Integer);
begin
//WriteLn('error ',ANumber);
Halt(ANumber);
end;
var
s, x : ts866;
i : Integer;
begin
s := #128#156#196;
x := s;
if (StringCodePage(s) <> 866) then
doerror(1);
if (StringCodePage(x) <> 866) then
doerror(2);
if (Length(x) <> Length(s)) then
doerror(3);
for i := 1 to Length(x) do
begin
if (Byte(x[i]) <> Byte(s[i])) then
doerror(4)
end;
end.