summaryrefslogtreecommitdiff
path: root/fpcdocs/sysutex/ex83.pp
blob: 44efec19d7af2d5635b14c9e6cf58806ae731026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Program Example82;

{$mode objfpc}

{ 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.