View previous topic :: View next topic |
Author |
Message |
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Wed Jul 06, 2005 12:13 am Post subject: List in directory & Subdirectory |
|
|
Hello everyone...
Congratulation for your work!!!
Here, I wanted to ask you how I could do to list all the textfile (*.txt) of un folder and its subfolder
I have do that, but I can't do the next... (that lists only the files of the directory but not the subdirectory)
Code: |
rem The Dialog
DIALOG CREATE,Test 1,-1,0,377,309
DIALOG ADD,EDIT,EDIT1,8,8,288,16,@windir()
DIALOG ADD,BUTTON,BUTTON1,8,304,64,16,...
DIALOG ADD,LIST,LIST1,32,8,360,240
DIALOG ADD,BUTTON,BUTTON2,280,304,64,24,Find !
DIALOG SHOW
:evloop
wait event
goto @event()
# Selection of the Folder
:button1button
%%file = @dirdlg()
if %%file
dialog set,EDIT1,%%file
end
goto evloop
# the list of the txtfile in the folder
:button2button
if @dlgtext(edit1)
list filelist,LIST1,@dlgtext(EDIT1)\*.txt
end
goto evloop
:close
exit
|
Last edited by GregLand on Sat Apr 15, 2017 4:17 pm; edited 1 time in total |
|
Back to top |
|
|
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Sat Apr 15, 2017 4:17 pm Post subject: |
|
|
Found a solution since long time, put it there to remember it in case of...
Code: |
rem The Dialog
DIALOG CREATE,Test 1,-1,0,377,331
REM *** Modified by Dialog Designer on 15/04/2017 - 18:22 ***
DIALOG ADD,EDIT,EDIT1,8,8,288,16,@windir()
DIALOG ADD,BUTTON,BUTTON1,8,304,64,16,...
DIALOG ADD,LIST,LIST1,32,8,360,240
DIALOG ADD,BUTTON,BUTTON2,280,304,64,24,Find !
DIALOG ADD,STATUS,STATUS1,STATUS1
DIALOG SHOW
:evloop
wait event
goto @event()
# Selection of the Folder
:button1button
%%file = @dirdlg()
if %%file
dialog set,EDIT1,%%file
end
goto evloop
# the list of the txtfile in the folder
:button2button
if @dlgtext(edit1)
%%folder = @dlgtext(edit1)
list create,1
list filelist,1,%%folder,*
list add,1,%%folder
repeat
list filelist,LIST1,@item(1)\*.txt,AHRS
%n = @next(1)
until @null(@item(1))
list close,1
END
DIALOG set,status1,@count(LIST1)
goto evloop
:close
exit |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|