mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-27 00:03:43 +02:00
34 lines
545 B
ObjectPascal
34 lines
545 B
ObjectPascal
{$apptype console}
|
|
uses
|
|
{$ifdef unix}
|
|
{$ifdef darwin}iosxwstr{$else}cwstring{$endif},
|
|
{$endif unix}
|
|
sysutils;
|
|
|
|
type
|
|
ts866 = type AnsiString(866);
|
|
|
|
procedure doerror(ANumber : Integer);
|
|
begin
|
|
WriteLn('error ',ANumber);
|
|
Halt(ANumber);
|
|
end;
|
|
|
|
var
|
|
s : ts866;
|
|
i : Integer;
|
|
ss : ShortString;
|
|
begin
|
|
s := '123'#196#200#250;
|
|
ss := s;
|
|
if (Length(s) <> Length(ss)) then
|
|
doerror(1);
|
|
for i := 1 to Length(s) do
|
|
begin
|
|
if (Byte(ss[i]) <> Byte(s[i])) then
|
|
doerror(2)
|
|
end;
|
|
|
|
WriteLn('Ok');
|
|
end.
|