mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 23:07:55 +02:00

- 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 -
30 lines
538 B
ObjectPascal
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.
|