Solved

How to get the linage of file?

Posted on 2000-03-23
2
134 Views
Last Modified: 2010-04-04
I want to get the linage of a Text file.
Besides Use ReadLn to sum the linage, Has a simply way or function to get it.

thanks
kelvin
0
Comment
Question by:kelvinyu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
vinnair earned 50 total points
ID: 2652183
I assume linage means the number of lines.

You can use the Tstringlist class to good effect.
Do the following:

function getnolines(filename: string): integer;
var
  Mylist: TStringList;
begin
  MyList := TStringList.Create;
  MyList.LoadFromFile(filename);
  Result := MyList.Count;
  MyList.Free;
end;

This piece of code is enough. This is one of the simplest way to work with text files.
0
 

Author Comment

by:kelvinyu
ID: 2659399
it's better than count the linage one by one

Thanks
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Multi-layered image in FireMonkey 9 87
Delphi: making a BW image transparent 10 133
Microsoft Access 97 and Delphi XE2 9 82
Firemonkey Queue list 1 48
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question