ex82.pp 347 B

12345678910111213141516171819
  1. Program Example82;
  2. {$mode objfpc}
  3. { This program demonstrates the StrToInt function }
  4. Uses sysutils;
  5. Begin
  6. Writeln (StrToInt('1234'));
  7. Writeln (StrToInt('-1234'));
  8. Writeln (StrToInt('0'));
  9. Try
  10. Writeln (StrToInt('12345678901234567890'));
  11. except
  12. On E : EConvertError do
  13. Writeln ('Invalid number encountered');
  14. end;
  15. End.