0x90h Posted January 19, 2008 Share Posted January 19, 2008 #include <File.au3> _FileListToArray ( $sPath [, $sFilter [, $iFlag]] ) and it does not work for me, please help. thanks in advance 0x90h nop Link to comment Share on other sites More sharing options...
weaponx Posted January 19, 2008 Share Posted January 19, 2008 The FileListToArray UDF included with AutoIt only supports one wildcard. See your options here:http://www.autoitscript.com/forum/index.ph...filelisttoarray Link to comment Share on other sites More sharing options...
Valuater Posted January 19, 2008 Share Posted January 19, 2008 This should do the trick expandcollapse popup$Files_List = _MultiFileListToArray(@ScriptDir, "*.txt|*.ini") ; for display only $GUI = GUICreate(' _MultiFileListToArray - DEMO') $Edit1 = GUICtrlCreateEdit("", 50, 50, 300, 300) For $x = 1 To UBound($Files_List) - 1 GUICtrlSetData(-1, $Files_List[$x] & @CRLF, 1) Next GUISetState() While GUIGetMsg() <> -3 WEnd ; end display only Func _MultiFileListToArray($sPath, $sFilter = "*", $iFlag = 0) Local $hSearch, $sFile, $asFileList[1], $sCount If Not FileExists($sPath) Then Return SetError(1, 1, "") If (StringInStr($sFilter, "\")) Or (StringInStr($sFilter, "/")) Or (StringInStr($sFilter, ":")) Or (StringInStr($sFilter, ">")) Or (StringInStr($sFilter, "<")) Or (StringStripWS($sFilter, 8) = "") Then Return SetError(2, 2, "") $sFilter = (StringSplit($sFilter, "|")) If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, "") For $sCount = 1 To $sFilter[0] $hSearch = FileFindFirstFile($sPath & "\" & $sFilter[$sCount]) If $hSearch = -1 Then If $sCount = $sFilter[0] Then Return SetError(4, 4, $asFileList) ContinueLoop EndIf While 1 $sFile = FileFindNextFile($hSearch) If @error Then SetError(0) ExitLoop EndIf If $iFlag = 1 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") <> 0 Then ContinueLoop If $iFlag = 2 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") = 0 Then ContinueLoop ReDim $asFileList[UBound($asFileList) + 1] $asFileList[0] = $asFileList[0] + 1 $asFileList[UBound($asFileList) - 1] = $sFile WEnd FileClose($hSearch) Next Return $asFileList EndFunc ;==>_MultiFileListToArray 8) Link to comment Share on other sites More sharing options...
0x90h Posted January 19, 2008 Author Share Posted January 19, 2008 this is just what i was lookin for realy nice, thanks for your help. regards 0x90h Link to comment Share on other sites More sharing options...
Valuater Posted January 19, 2008 Share Posted January 19, 2008 Welcome!!! 8) Link to comment Share on other sites More sharing options...
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