forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


List in directory & Subdirectory

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 156
Location: FRANCE

PostPosted: Wed Jul 06, 2005 12:13 am    Post subject: List in directory & Subdirectory Reply with quote

Hello everyone...
Congratulation for your work!!! Very Happy
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) Confused

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
View user's profile Send private message Visit poster's website
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 156
Location: FRANCE

PostPosted: Sat Apr 15, 2017 4:17 pm    Post subject: Reply with quote

Found a solution since long time, put it there to remember it in case of... Very Happy

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group