| View previous topic :: View next topic |
| Author |
Message |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Sun Jan 25, 2004 1:16 pm Post subject: For the people who need it... Recusive directory reading! |
|
|
I just made a quick program for searching specific types of files on the harddrive. I made it for my MP3-database program.
| Code: | TITLE Searching
DIALOG CREATE,Searching,-1,0,250,50,NOTITLE
DIALOG ADD,GROUP,Group,0,4,242,46,Searching for MP3-files...
DIALOG ADD,TEXT,Path,20,12,225,,Loading directory structure...
DIALOG SHOW
%%Path = C:
LIST CREATE, 1
LIST FILELIST, 1, %%Path, *DHSR
%%TotalSubs = @COUNT(1)
%%CurrentSub = 0
REPEAT
IF @GREATER(%%Totalsubs, 0)
DIALOG SET, Path, @ITEM(1)
LIST FILELIST, 1, @ITEM(1)\*.mp3
LIST DELETE, 1
%%CurrentSub = @SUCC(%%CurrentSub)
END
UNTIL @EQUAL(%%CurrentSub, %%TotalSubs)
INFO @COUNT(1) MP3-files found!
LIST SAVEFILE, 1, @PATH(%0)\Filelist.txt
LIST CLOSE, 1
RUN @SHORTNAME(@PATH(%0)\Filelist.txt)
|
You can remove a few lines at the end of the program, but this is only for showing you the output!
Greetz,
Raymond |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jan 25, 2004 4:27 pm Post subject: |
|
|
I moved your topic to the VDS 3 Source Code Section
EDIT: Moved back to General Help to avoid duplicate post in VDS 3 Source code _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Jan 26, 2004 2:50 am Post subject: |
|
|
Very nice. I made command for it.
| Code: |
#define command,ListGetFiles
:ListGetFiles
#ListGetFiles <Path>,<File Spec (ie. *.mp3)>,<List # (Will be created)>
# %%Path = G:\~Developer CD~\Src Code
LIST CREATE, %3
LIST FILELIST, %3, %1, *DHSR
%9 = @COUNT(%3)
%8 = 0
REPEAT
IF @GREATER(%9, 0)
LIST FILELIST, %3, @ITEM(%3)\%2
LIST DELETE, %3
%8 = @SUCC(%
END
UNTIL @EQUAL(%8, %9)
exit
|
_________________ Chris
Http://theblindhouse.com
Last edited by LiquidCode on Wed Jan 28, 2004 12:32 pm; edited 2 times in total |
|
| Back to top |
|
 |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Mon Jan 26, 2004 11:22 am Post subject: |
|
|
Very nice, only I have version 3.51 of VDS, so I cannot use your 'command'... But I have an idea how it works by looking at it, so thanks anyways!
Raymond |
|
| 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
|
|