When reading a file, the number of rows is counted. Why is the number of rows more than the actual number of rows? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061016105832236.html
My Program As shown in the following figure, if there are 10 rows in boat.txt and the result of total is 11, why is the last multiple rows in the output boat1 0? Why is the result of my change to Fortran Program total 10 ??
VaR
G, F: textfile;
I, j, scale, multiple, total: integer;
Xmax, Ymax, xmin, ymin: integer;
Nn, NX, NY, NB: integer;
Begin
Assignfile (F, 'e: \ Kong \ Delphi \ picture \ boat.txt ');
Assignfile (G, 'e: \ Kong \ Delphi \ picture \ boat1.txt ');
Reset (f );
Rewrite (g );
Total: = 0;
While not EOF (f) Do
Begin
Readln (F, I, j );
Writeln (G, I, j );
Total: = total + 1;
End;
Closefile (f );
Closefile (g );
Memo1.lines. Add (inttostr (total ));
End;
End.
Looking forward to the answer
Some texts have blank lines at the end. FORTRAN may not include this. Do you want to use the binary editor?