Hi.
I'm trying to use FindFirst() (et al.) in the console. Compiling my source (I'm pretty new to FPC), ppcrossx64 gives me:
>>> Error: Call by var for arg no. 1 has to match exactly: Got "UnicodeString" expected "TRawbyteSearchRec"
The code snippet looks like this:
{$Mode DelphiUnicode}
var
dir: UnicodeString;
search_rec: TUnicodeSearchRec;
begin
if FindFirst(dir + '/*', faAnyFile, search_rec) <> -1 then
...
The docs (3.2.2) state:
76.15.118 FindFirst
Declaration:
function FindFirst(const Path: UnicodeString; Attr: LongInt; out Rslt: TUnicodeSearchRec) : LongInt
function FindFirst(const Path: RawByteString; Attr: LongInt; out Rslt: TRawbyteSearchRec) : LongIn
so I should normally be good to go.
What am I doing wrong?