mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:18:12 +02:00
27 lines
467 B
ObjectPascal
27 lines
467 B
ObjectPascal
{$mode objfpc}
|
|
|
|
Program BCDTest;
|
|
|
|
Uses SysUtils;
|
|
|
|
var
|
|
gotexcept: boolean;
|
|
Begin
|
|
WriteLn (BCDToInt ($1234)); { should retuen 1234 }
|
|
if (BCDToInt ($1234)) <> 1234 then
|
|
halt(1);
|
|
|
|
gotexcept:=false;
|
|
try
|
|
WriteLn (BCDToInt ($A0)); { Invalid value }
|
|
except
|
|
gotexcept:=true;
|
|
end;
|
|
if not gotexcept then
|
|
halt(1);
|
|
|
|
WriteLn (BCDToInt ($7D)); { should return -7 }
|
|
if (BCDToInt ($7D)) <> -7 then
|
|
halt(2);
|
|
End.
|