Solved

Findclose

Posted on 1998-09-25
2
200 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

785 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