Hi guys,
I work on a script at the moment and I need to get the file names of a directory. I tried to use this :
var
searchResult : TSearchRec;
begin
// Try to find regular files matching Unit1.d* in the current dir
if FindFirst('Unit1.d*', faAnyFile, searchResult) = 0 then
begin
repeat
ShowMessage('File name = '+searchResult.Name);
ShowMessage('File size = '+IntToStr(searchResult.Size));
until FindNext(searchResult) <> 0;
// Must free up resources used by these successful finds
FindClose(searchResult);
end;
end;
But when I compile : TSearchRec isn't recognize as a valid variable (undeclared type TSearchRec) !
I also tried with the Pascal var type : SearchRec, but it doesn't seemed to be valid as well...
So I had a look to the Usine script references and I didn't find the functions Findfirst, FindNext and FindClose ???
Is there another way to do it ?
Thanks
Kenan
Get a file list in a script
hope all scripts gurus are not in holidays...
Unless Senso has something undocumented up his sleeve, it seems that it's not possible to do these things from within a script.
I too had a look at the scripts references and couldn't find anything that lists files names.
I too had a look at the scripts references and couldn't find anything that lists files names.
Bjørn S
Who is online
Users browsing this forum: No registered users and 12 guests
