tommeke228 Posted June 21, 2008 Posted June 21, 2008 (edited) Uhm i have this $search = FileFindFirstFile("*.txt") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern",1) EndIf while 1 $file = FileFindNextFile($search) If @error Then ExitLoop _GUICtrlListBox_AddFile ($List1, $file) wendoÝ÷ Ù»§µ«¢+ØÀÌØíÍÉ ô¥±¥¹¥ÉÍÑ¥±¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíMÉ¥ÁÑÌÀäÈìÅÕ½ÐìµÀìÅÕ½Ð쨹ÑáÐÅÕ½Ðì¤ something like this that it search in the scriptdir -> in the map -> and then look for txt files can any help plz Edited June 21, 2008 by tommeke228
MHz Posted June 21, 2008 Posted June 21, 2008 Set the paths up and it may display what you want. FileFileFirstName() returns the filename so you need to build the path your self. $search = FileFindFirstFile(@ScriptDir & "\Scripts\*.txt") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern", 1) Else While 1 $file = FileFindNextFile($search) If @error Then ExitLoop _GUICtrlListBox_AddFile($List1, @ScriptDir & "\Scripts\" & $file) WEnd FileClose($search) EndIf
FreeFry Posted June 21, 2008 Posted June 21, 2008 (edited) What's wrong with:$search = FileFindFirstFile(@ScriptDir & "\Scripts\*.txt") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern",1) EndIf while 1 $file = FileFindNextFile($search) If @error Then ExitLoop _GUICtrlListBox_AddFile ($List1, $file) wend?Edit:Doh, to slow. Edited June 21, 2008 by FreeFry
FreeFry Posted June 21, 2008 Posted June 21, 2008 Or is the problem you're having that you want it to search in the @ScriptDir folder, and all its subfolders for *.txt files?
tommeke228 Posted June 21, 2008 Author Posted June 21, 2008 (edited) Or is the problem you're having that you want it to search in the @ScriptDir folder, and all its subfolders for *.txt files? uhm this code is working now FileChangeDir(@scriptdir & "\scripts\") $search = FileFindFirstFile("*.txt") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern",1) EndIf while 1 $file = FileFindNextFile($search) If @error Then ExitLoop _GUICtrlListBox_AddFile ($List1, $file) wend (all the txt files are saved in a map named Scripts) thx Edited June 21, 2008 by tommeke228
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now