wimhek Posted July 15, 2007 Share Posted July 15, 2007 Has anybody coded the ultimate commands after the fileopendialog (option 1+4). The logic after selecting 1 file or multiple files is different. Thanx. Link to comment Share on other sites More sharing options...
xcal Posted July 15, 2007 Share Posted July 15, 2007 (edited) A few ways you could tackle this...here's one: $var = _MyFileOpenDialog() #region - Just for displaying results If IsArray($var) Then Local $tmp For $i = 2 To UBound($var) - 1 $tmp &= $var[$i] & @LF Next MsgBox(0, '', $tmp) Else MsgBox(0, '', $var) EndIf #endregion Func _MyFileOpenDialog() Local $file, $array $file = FileOpenDialog('Select File(s)', @HomeDrive, 'All Files (*.*)', 7) If @error Then Return 'No files selected' If Not StringInStr($file, '|') Then Return $file $array = StringSplit($file, '|') If StringRight($array[1], 1) <> '\' Then $array[1] = $array[1] & '\' For $i = 2 To $array[0] $array[$i] = $array[1] & $array[$i] Next Return $array EndFunc Edited July 15, 2007 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
wimhek Posted July 15, 2007 Author Share Posted July 15, 2007 Has anybody coded the ultimate commands after the fileopendialog (option 1+4). The logic after selecting 1 file or multiple files is different. Thanx.Thank You, I codes something similair, but your code looks more compact. At the end I have still a problem. When selected one file i must proces $files, and when selected more files I must process $tmp.So there is stiil needed some coding like array delete or arrayinsert. Link to comment Share on other sites More sharing options...
xcal Posted July 15, 2007 Share Posted July 15, 2007 (edited) I made a slight mistake. See my edit, incase that helps. edit - You just need to check if it's returning an array (IsArray(), or change the function to always return an array.) Edited July 15, 2007 by xcal How To Ask Questions The Smart Way 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