fpc/docs/sysutex/ex83.pp
1999-06-05 10:49:59 +00:00

17 lines
351 B
ObjectPascal

Program Example82;
{ This program demonstrates the StrToInt function }
Uses sysutils;
Begin
Writeln (StrToIntDef('1234',0));
Writeln (StrToIntDef('-1234',0));
Writeln (StrToIntDef('0',0));
Try
Writeln (StrToIntDef('12345678901234567890',0));
except
On E : EConvertError do
Writeln ('Invalid number encountered');
end;
End.