GetFileList |
Files | |
Aptilis 1 |
GetFileList(DestinationArrayName[][, Filter])
getFileList will fill the array you specified with all the file names of the current directory.
The optional filter allows to get a list of files restricted to, for example, files
with a given extension. The rules that apply to the filter are the same as the ones
that apply to match and this an aptilis implementation,
not a system one, so that the behaviour of the filter functions is identical
across the various platforms Aptilis runs on.
You can check which directory you're in with
getCurrentDirectory
and change to another directory with
changeDirectory.
The array you specified is cleared of any previous values before being filled
with the file names.
Return Value:
The number of files found and the file names in the specified array.
Example 1:
chdir("c:\\") n = getfilelist(fl[]) for i=0 to n-1 print(fl[i]$, "\n") end forResult:
autoexec.bat config.sys command.com |
Example 2:
chdir("c:\\aptilis") // We just want aptilis files starting with a 'g' n = getfilelist(fl[], "g*.e.txt") for i=0 to n-1 print(fl[i]$, "\n") end forResult:
getvariable.e.txt graphics.e.txt getrecord.e.txt getrecord2.e.txt getrecordnear.e.txt getrecord2near.e.txt getdirlist.e.txt |