Difference between revisions of "$findfile"
From Scriptwiki
m (first!) |
m (added semi-colons) |
||
Line 5: | Line 5: | ||
''dir'' is the directory in which has to be searched. | ''dir'' is the directory in which has to be searched. | ||
− | ''matchstring'' is the string to match the filename. | + | ''matchstring'' is the string to match the filename. You can specify multiple searches at once, by seperating them with semi-colons. |
''depth'' is how many dirs deep have to be searched. If ''depth'' is 0 or 1, it will only search the specified dir without it's subdirs. In case you don't specify ''depth'' it will search all subdirs. | ''depth'' is how many dirs deep have to be searched. If ''depth'' is 0 or 1, it will only search the specified dir without it's subdirs. In case you don't specify ''depth'' it will search all subdirs. |
Revision as of 18:25, 20 October 2007
Finds files in a specified directory.
$findfile(dir,matchstring,N[,depth][,@window | command])
Returns the N'th matching filename, or when N=0 the number of matching filenames.
dir is the directory in which has to be searched.
matchstring is the string to match the filename. You can specify multiple searches at once, by seperating them with semi-colons.
depth is how many dirs deep have to be searched. If depth is 0 or 1, it will only search the specified dir without it's subdirs. In case you don't specify depth it will search all subdirs.
If you specify a custom window name @window which has a listbox, it will add the found files to the listbox.
If you specify the command this command will be executed for each found file, where $1- is the filename.