rbhkamal Posted March 6, 2006 Share Posted March 6, 2006 Why this function doesnt work? Its supposed to make a list of all files found in a specific directory , but it only finds the first file or maybe the second. thanks, ;+++++++++++++++++++++ Global $file , $ret $ret = _makefileslist( @ScriptDir & '\' , '*.txt' , $file , 10 ) Func _makefileslist( $path, $find , ByRef $array , $max ) ;##this function will DIM $array $max times and make a list of files found.### ;### if failed will return -1 else the number fo files found. Dim $array[$max + 1] Local $a = 0 $array[1] = FileFindFirstFile( $path&$find ) If $array[1] = -1 Then ;Exit on if not found FileClose($array[1]) Return -1 Else Do ;Loop untill no more files found or $a = $max $a = $a + 1 $array[$a] = FileFindNextFile($array[1]) If @error = 1 Then FileClose($array[1]) Return $a - 1 EndIf Until $a = $max EndIf EndFunc ;---------------------------------------------------------------- "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
Valuater Posted March 6, 2006 Share Posted March 6, 2006 maybe you should look into FileListToArray() in help 8) Link to comment Share on other sites More sharing options...
rbhkamal Posted March 6, 2006 Author Share Posted March 6, 2006 Yup that surely helped, thanks 'Valuater' .maybe you should look intoFileListToArray()in help8) "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix 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