mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:29:28 +02:00
19 lines
347 B
ObjectPascal
19 lines
347 B
ObjectPascal
Program Example82;
|
|
|
|
{$mode objfpc}
|
|
|
|
{ This program demonstrates the StrToInt function }
|
|
|
|
Uses sysutils;
|
|
|
|
Begin
|
|
Writeln (StrToInt('1234'));
|
|
Writeln (StrToInt('-1234'));
|
|
Writeln (StrToInt('0'));
|
|
Try
|
|
Writeln (StrToInt('12345678901234567890'));
|
|
except
|
|
On E : EConvertError do
|
|
Writeln ('Invalid number encountered');
|
|
end;
|
|
End. |