Solved

Findclose

Posted on 1998-09-25
2
194 Views
Last Modified: 2010-04-06
Hi,

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
   begin
      res := FindFirst( fullpath + '\*.RTS' , faReadOnly or faArchive , rec );
      while res = 0 do
      begin
         files.Add( fullpath + '\' + rec.Name );
         res := FindNext( rec );
      end;
      FindClose( rec );
   end;
0
Comment
Question by:Didi
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
Comment Utility
FindClose( res );

not

FindClose( rec ) ;
0
 
LVL 3

Expert Comment

by:Matvey
Comment Utility
- ??? 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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now