ArrayArrayArrayArray BrainModular BrainModular Users Forum 2011-08-23T13:18:42+02:00 https://brainmodular.com/forums/app.php/feed/topic/3084 2011-08-23T13:18:42+02:00 2011-08-23T13:18:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20883#p20883 <![CDATA[Get a file list in a script]]>
Thanks for the answer...

Kenan

Statistics: Posted by Ken29 — 23 Aug 2011, 13:18


]]>
2011-08-22T08:47:17+02:00 2011-08-22T08:47:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20867#p20867 <![CDATA[Get a file list in a script]]>
I too had a look at the scripts references and couldn't find anything that lists files names.

Statistics: Posted by bsork — 22 Aug 2011, 08:47


]]>
2011-08-21T20:55:50+02:00 2011-08-21T20:55:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20860#p20860 <![CDATA[Get a file list in a script]]> Statistics: Posted by nay-seven — 21 Aug 2011, 20:55


]]>
2011-08-21T20:21:19+02:00 2011-08-21T20:21:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20858#p20858 <![CDATA[Get a file list in a script]]>
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

Statistics: Posted by Ken29 — 21 Aug 2011, 20:21


]]>
BrainModular BrainModular Users Forum 2011-08-23T13:18:42+02:00 https://brainmodular.com/forums/app.php/feed/topic/3084 2011-08-23T13:18:42+02:00 2011-08-23T13:18:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20883#p20883 <![CDATA[Get a file list in a script]]>
Thanks for the answer...

Kenan

Statistics: Posted by Ken29 — 23 Aug 2011, 13:18


]]>
2011-08-22T08:47:17+02:00 2011-08-22T08:47:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20867#p20867 <![CDATA[Get a file list in a script]]>
I too had a look at the scripts references and couldn't find anything that lists files names.

Statistics: Posted by bsork — 22 Aug 2011, 08:47


]]>
2011-08-21T20:55:50+02:00 2011-08-21T20:55:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20860#p20860 <![CDATA[Get a file list in a script]]> Statistics: Posted by nay-seven — 21 Aug 2011, 20:55


]]>
2011-08-21T20:21:19+02:00 2011-08-21T20:21:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=3084&p=20858#p20858 <![CDATA[Get a file list in a script]]>
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

Statistics: Posted by Ken29 — 21 Aug 2011, 20:21


]]>