I have some problem with FindFirst which should be very simple but
which I can't solve for almost 2 days already.
In one of my programs I use FindFirst(path,srchrc), where
path:PChar, srcgrc: TSearchRec. Uses WinDOS is defined.
Now, the problem is that it gives me Error 26: Type mismatch,
placing cursor after srchrc. I have no idea why it's so.
To test, I substitute with FindNext(srchrc) and it was compiled
succesfully.
Any help would be greatly appreciated !
Thanks,
Vadim Cherni
Campbell CA USA
That short piece of program is attached for your reference.
BEGIN -- Cut Here -- cut here
program USENET;
uses Strings, Windos;
type
TSearchRec=record
Fill:array[1..21] of Byte;
Attr:Byte;
Time:Longint;
Size:Longint;
Name:{PChar}array[0..12{0}] of Char;
end;
var
F, F_OUT: Text;
S: array[0..255] of Char;
SrchRC1: TSearchRec;
Name_o: array[0..fsPathname] of Char;
{Dir: array[0..fsDirectory] of Char;}
Name1:array[0..fsFileName] of Char;
Ext:array[0..fsExtension] of Char;
Dir:array[0..(fsDirectory+6)] of Char;
DirPChar:PChar;
N, N1, N2, N3:Integer;
begin
writeln ('Please input an output file name');
readln (name_o);
assign (F_out,name_o);
append (F_out);
filesplit (name_o, Dir, Name1, Ext);
strecopy(dir,'*.txt');
writeln('Processing file',dir);
N3:=0;
dirPChar:=dir; {convertion to PChar format}
while Doserror=0 do
begin
!!! findfirst (dirPChar,srchrc1); {find input files' directory by the one of output file}
assign(F,srchrc1.name);
reset(F);
END -- Cut Here -- cut here