Why is the number of rows counted when reading a file more than the actual number of rows?

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.