ccdust Posted December 22, 2005 Share Posted December 22, 2005 Hello! How to get an array of files in directory with desired type .MAP? Ponosen prebivalec Slovenije!My blog http://blog.babnopolje.net/ Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2005 Developers Share Posted December 22, 2005 Check out the _FileListToArray() UDF that comes with the Beta installer.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Share Posted December 22, 2005 actual useage #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@HomeDrive, "*.MAP", 1) If (Not IsArray($FileList)) Or (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") 8) Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Share Posted December 22, 2005 (edited) Check out the _FileListToArray() UDF that comes with the Beta installer.... i notice in help it states If (Not IsArray($FileList)) and (@Error=1) Then but the repacement of "and" with "or" seemed to be correct way... as in my post above ??? 8) Edited December 22, 2005 by Valuater Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2005 Developers Share Posted December 22, 2005 (edited) i notice in help it states If (Not IsArray($FileList)) and (@Error=1) Then but the repacement of "and" with "or" seemed to be correct way... as in my post above ??? 8)The IF is correct because it only filters out the case of "No files found" ..... Maybe the UDF needs to be updated in case no file is found to generate Error(1)... Edited December 22, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ccdust Posted December 23, 2005 Author Share Posted December 23, 2005 (edited) Thanks for help here is my solution #Include <File.au3> #Include <Array.au3> $vsebinamape = _FileListToArray (".", "*.MAP") Dim $listamap = _ArrayToString($vsebinamape, "|", 1) $mapaS = GUICtrlCreateCombo("", 15, 20, 180) GUICtrlSetData(-1, $listamap) GUICtrlCreateLabel("Num. of maps: " & $vsebinamape[0], 120, 55) I've needed this for duke3d launcher! Edited December 23, 2005 by ccdust Ponosen prebivalec Slovenije!My blog http://blog.babnopolje.net/ Link to comment Share on other sites More sharing options...
Valuater Posted December 23, 2005 Share Posted December 23, 2005 Thanks for help here is my solution #Include <File.au3> #Include <Array.au3> $vsebinamape = _FileListToArray (".", "*.MAP") Dim $listamap = _ArrayToString($vsebinamape, "|", 1) $mapaS = GUICtrlCreateCombo("", 15, 20, 180) GUICtrlSetData(-1, $listamap) GUICtrlCreateLabel("Num. of maps: " & $vsebinamape[0], 120, 55) I've needed this for duke3d launcher! First... Welcome to the forums Second Very good coding... for a 3rd post 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