marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Jun 18, 2004 11:43 am Post subject: VDSFLIST and Multiple masks search solution? |
|
|
Hello,
Ive been trying to find a solution to the limitation of one file mask that VDSFLIST has. Now I want to search for multiple file types in one search.
I know in VDS in can be done with scripting, but for some reason when the filelist starts for the first time it takes long and also its not using threads.
So here is a VDSFLIST example(which comes with VDSDLL3 ) that vtol did and I tried modifying it to support multiple file types , but does somebody has a better solution than this?
| Code: | #define command,flist
#define function,flist
OPTION DECIMALSEP, "."
external @path(%0)vdsflist.dll
flist threads,threads
DIALOG CREATE,flist test,-1,0,400,190
DIALOG ADD,LIST,box1,15,11,378,115
DIALOG ADD,BUTTON,test,148,15,43,19,Test
DIALOG ADD,BUTTON,abort,148,75,43,19,Abort
DIALOG ADD,BUTTON,cancel,148,340,43,19,Close
DIALOG ADD,BUTTON,save,148,275,43,19,Save
DIALOG ADD,STATUS,status,Ready...
DIALOG SHOW
gosub enablesearch
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:enablesearch
dialog title,flist test
dialog enable,test
dialog enable,cancel
dialog enable,save
dialog disable,abort
dialog cursor
wait "0.2"
exit
:disablesearch
dialog cursor,wait
wait "0.2"
dialog title,"Please wait, performing search..."
dialog disable,test
dialog disable,save
dialog disable,cancel
dialog enable,abort
exit
:cancel-import
dialog title,flist test
dialog enable,test
dialog enable,cancel
dialog enable,save
dialog disable,abort
dialog cursor
wait "0.2"
goto evloop
:testBUTTON
LIST clear,box1
gosub disablesearch
%%search_area = @DIRDLG(Choose your file list,c:\,shownewfolderbutton)
IF @equal(%%search_area, )
goto cancel-import
END
dialog set,status,Searching on drive Please wait..
flist flags,F
flist list,%%search_area,*.bat,ahrs*
%%txt = 1
%%doc = 1
wait "0.2"
goto evloop
:saveBUTTON
FLIST SAVE,c:\zztest\example.txt
wait "1"
info Successefully saved:@FILL(3,,L) C:\ZZTEST\Example.txt
goto evloop
:abortBUTTON
flist abort
wait "0.4"
LIST clear,box1
goto evloop
:FLISTDONE
list append,box1,@flist(get)
dialog set,status,Number of files found: @count(box1)
wait "0.2"
#multiple masks
if @equal(%%txt,1)
gosub txtsearch
end
if @equal(%%doc,1)
gosub docsearch
end
gosub enablesearch
goto evloop
:txtsearch
#info doing txt
wait,"0.5"
flist flags,F
flist list,%%search_area,*.txt,ahrs*
%%txt = 0
exit
:docsearch
# info doing doc
wait,"0.5"
flist flags,F
flist list,%%search_area,*.doc,ahrs*
%%doc = 0
exit
:cancelBUTTON
:close
flist abort
exit |
Thanks in advance for your ideas and suggestions... |
|