1 { Sample problem proba.dpr }
\r
5 { $Id: sumit.dpr,v 1.1 2005/03/06 05:13:57 laned Exp $ }
\r
7 uses SysUtils; { for StrToInt }
\r
9 procedure processfile (filename : string);
\r
18 AssignFile (tf, filename);
\r
19 {$i-} reset (tf); {$i+}
\r
20 if ioresult = 0 then
\r
22 while not eof (tf) do
\r
30 writeln('The sum of the positive integers is ',sum);
\r
34 writeln ('Could not open file '+filename+' for read ');
\r
39 processfile ('sumit.dat');
\r