ex83.pp 351 B

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