Solved

Findclose

Posted on 1998-09-25
2
205 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
[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
 
LVL 8

Accepted Solution

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

not

FindClose( rec ) ;
0
 
LVL 3

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month7 days, 4 hours left to enroll

623 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