Posted on 1998-09-25
Last Modified: 2010-04-06

The code below gives an error on  FindClose( rec );
rec is of type TSearchRec
The error : incompatible types integer and Tsearchrec
In the help i find that the parameter of Findclose should be of type Tsearchrec. What am i doing wrong and is there a solution for this  

for i := 0 to langs.Count - 1 do
      res := FindFirst( fullpath + '\*.RTS' , faReadOnly or faArchive , rec );
      while res = 0 do
         files.Add( fullpath + '\' + rec.Name );
         res := FindNext( rec );
      FindClose( rec );
Question by:Didi
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

Accepted Solution

Answers2000 earned 50 total points
ID: 1340846
FindClose( res );


FindClose( rec ) ;

Expert Comment

ID: 1340847
- ??? Answer200 - ???

FindClose is also an API call (the same name), but it's parameter is a handle, which is an integer, not a record.

You have to write then SysUtils.FindClose( rec ) instead.

Good luck, Matvey

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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