[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Findclose

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
Didi
Asked:
Didi
1 Solution
 
Answers2000Commented:
FindClose( res );

not

FindClose( rec ) ;
0
 
MatveyCommented:
- ??? 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

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now