Moderators Melba23 Posted February 7, 2013 Author Moderators Share Posted February 7, 2013 johnmcloud,A good start but I hope you do not mind if I suggest a few improvements: - Reorder the include/exclude inputs by putting the "Folder Exclude" under the 2 "File/Folder Include/Exclude" lines so that the 3 reflect the order used in the UDF parameter.- Adjust the "Folder Exclude" input so that it only shows the folder name and not the whole path as that is what the UDF uses (I can help you develop a Regex to do that). Also use the selected path as the root of the "Folder Exclude" folder selection dialog - after all the folders chosen need to be on that path! - Restore the tooltips to the include/exclude inputs that were in the original script which explained how to add multiple filters by using ";".M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted February 7, 2013 Share Posted February 7, 2013 johnmcloud, A good start but I hope you do not mind if I suggest a few improvements: Absolutely not I have updated my previus post with your suggestion, check it out ( P.S You have tested any type of combination? I doubt that i have made some mistake ) Next time i'll add the ArrayDisplay with the other GUI For the "folder name and not the whole path", i have used: GUICtrlSetData($FolderOutput, StringRegExpReplace(StringTrimRight($Dir, 1), '.*\\|\.[^.]*$', '')) My StringRegExpReplace work with path like C:TestMyFolder But the path for the UDF is C:TestMyFolder I don't know how to make everything with only one StringRegExpReplace insead to use StringTrimRight before Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 7, 2013 Author Moderators Share Posted February 7, 2013 johnmcloud, Very nice - a suggested change to the code to help with the path and folder inputs (only using a single RegEx ): While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_InputPath _Select_Folder($InputPath) ; This selection should not be limited <<<<<<<<<<<< Case $Button_InputPathExclude _Select_Folder($InputPathExclude, GUICtrlRead($InputPath), 1) ; Reordered parameters <<<<<<<<<<<<< Case $Button_Generate _Generate_RecFileListToArray() EndSwitch WEnd Func _Select_Folder($FolderOutput, $StartPath = "", $FolderName = 0) ; Reordered parameters <<<<<<<<<<<<<<< $Dir = FileSelectFolder("", $StartPath, 2, @ScriptDir) If @error Then ; Clear the input GUICtrlSetData($FolderOutput, "") Else Switch $FolderName Case 0 ; We return the folder as a path ; This is where you would add the trailing "\" if required <<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetData($FolderOutput, $Dir) Case 1 ; We return only the name $sName = StringRegExpReplace($Dir, "^.*\\(.*)$", "$1") If GUICtrlRead($FolderOutput) Then GUICtrlSetData($FolderOutput, GUICtrlRead($FolderOutput) & ";" & $sName) Else GUICtrlSetData($FolderOutput, $sName) EndIf EndSwitch EndIf EndFunc ;==>_Select_Folder And one more suggestion - add a checkbox to ask if the path should have a trailing "" and then do it if required at the point I indicate. Finally, are you going to have some simple error-checking? For example if folders are to be excluded, the UDF must be set up to return both files and folder and recur. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted February 7, 2013 Share Posted February 7, 2013 (edited) johnmcloud, Very nice - a suggested change to the code to help with the path and folder inputs (only using a single RegEx ) Done And one more suggestion - add a checkbox to ask if the path should have a trailing "" and then do it if required at the point I indicate. Instead of a checkbox, it's better to do this? Automatically add a slash to the path if need Switch $FolderName Case 0 If StringRight($Dir, 1) <> "\" Then GUICtrlSetData($FolderOutput, $Dir & "\") Else GUICtrlSetData($FolderOutput, $Dir) EndIf Finally, are you going to have some simple error-checking? For example if folders are to be excluded, the UDF must be set up to return both files and folder and recur. M23 If you say how i need to setup i'll do it, write it in a simple way like If "Path exclude folder" is selected Then Set "Return both files and folders (Default)" And Set "Search in all subfolders (unlimited)" Or i'll not understand you Edited February 7, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 7, 2013 Author Moderators Share Posted February 7, 2013 (edited) johnmcloud,Personally, I do think that having an option for the trailing "" is worth it - but you are the one coding this GUI so you choose. If you do want to add one automatically then all you have to do is add it - FileSelectFolder only returns a trailing "" on a drive root and then it does not matter if you have 2 of them ("C:" works just as well as "C:"). And I suggest you forget error-checking - all you are doing is helping with syntax and it woudl only complicate things. M23Edit:You can always use this regex to force a single trailign slash if you wish:$sPath = "C:\Test\Test" $sPath = StringRegExpReplace($sPath & "\", "(\\+)", "\\") $sPath_Slash = "C:\Test\Test\" $sPath_Slash = StringRegExpReplace($sPath_Slash & "\", "(\\+)", "\\") MsgBox(0, "Result", $sPath & @CRLF & $sPath_Slash) Edited February 7, 2013 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 7, 2013 Moderators Share Posted February 7, 2013 (edited) I finally got around to giving this UDF a whirl today, and wanted to say great work as always I did notice one item, on page 1 of this discussion. In your example, you have something akin to what is below for returning an array of everything except .exe files: $aArray = _RecFileListToArray($sAutoItDir, "*|*.exe", 1, 0, 1, 0) ConsoleWrite("Error: " & @error & " - " & " Extended: " & @extended & @CRLF) _ArrayDisplay($aArray, "Non .EXE files") For me, this returns an error of 1 (Extended 2, invalid include list). I have had to do it like this. Just curious if this was just a typo in the example, or if I am doing something incorrectly: Local $aArray = _RecFileListToArray($sAutoItDir, "*", 1, 0, 1, 0, "*.exe") _ArrayDisplay($aArray) Edited February 7, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2013 Author Moderators Share Posted February 8, 2013 JLogan3o13,Alas I cannot reproduce that error with either the code from the post itself (whch does sometimes get corrupted by the forum software) or the code in the zip. Both versions of the syntax work perfectly. The change to the "include/exclude" list syntax was only introduced in the last release - earlier versions will indeed return those error settings when used with "*|*.exe" and work with the separated lists. Are you sure you have the most recent version of the UDF from the first page of the thread. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted February 8, 2013 Share Posted February 8, 2013 Melba, I have updated the script, check it out. If you want to change something, just say. I'd like to add a simple error checking for the "exclude folder", buti don't know how many kinds of combinations are possible if an folder is excluded Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2013 Author Moderators Share Posted February 8, 2013 johnmcloud,There was a major problem in the "Hidden/System/Link" checkbox code - it was only applying these additional checks when the UDF was returning folders and not in all cases. You need to replace lines #127-#146 with this code:If GUICtrlRead($ComboFileFolder) = "Return both files and folders (Default)" Then $FileFolder = "0" ElseIf GUICtrlRead($ComboFileFolder) = "Return files only" Then $FileFolder = "1" Else $FileFolder = "2" EndIf Local $HiddenFiles_Folder, $SystemFiles_Folder, $LinkJuction_Folder If GUICtrlRead($CheckboxHiddenFiles_Folder) = $GUI_CHECKED Then $HiddenFiles_Folder = " + 4" EndIf If GUICtrlRead($CheckboxSystemFiles_Folder) = $GUI_CHECKED Then $SystemFiles_Folder = " + 8" EndIf If GUICtrlRead($CheckboxLinkJuction_Folder) = $GUI_CHECKED Then $LinkJuction_Folder = " + 16" EndIf $FileFolder &= $HiddenFiles_Folder & $SystemFiles_Folder & $LinkJuction_FolderNow it applies the additional values in all cases. Other than that it looks very nice - congratulations. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AZJIO Posted February 8, 2013 Share Posted February 8, 2013 johnmcloud Lock the parent window when opening a child. During the test, you can add the output of search time. Trim options on the right, if they are by default My other projects or all Link to comment Share on other sites More sharing options...
johnmcloud Posted February 8, 2013 Share Posted February 8, 2013 (edited) johnmcloud,There was a major problem in the "Hidden/System/Link" checkbox code - it was only applying these additional checks when the UDF was returning folders and not in all cases. You need to replace lines #127-#146 with this code:Now it applies the additional values in all cases. Other than that it looks very nice - congratulations. That wasn't a bug, but was a feature I misunderstood the function and i have updated the codeThanksjohnmcloudLock the parent window when opening a child.During the test, you can add the output of search time.Done for both but i don't have understood:Trim options on the right, if they are by default Edited February 8, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2013 Author Moderators Share Posted February 8, 2013 johnmcloud,That wasn't a bug, but was a featureM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted February 9, 2013 Share Posted February 9, 2013 (edited) AZJIO, Melba, I have update the GUI: I have removed from the ConsoleWrite/Editbox the default parameter, please check it out if it is error-bug free. I have also add the disable-enable input for the Exclude Folder based on Combobox selection, I hope that is correct. Edited February 9, 2013 by johnmcloud Link to comment Share on other sites More sharing options...
OliverA Posted February 10, 2013 Share Posted February 10, 2013 (edited) AZJIO, Melba,I have update the GUI:I have removed from the ConsoleWrite/Editbox the default parameter, please check it out if it is error-bug free.I have also add the disable-enable input for the Exclude Folder based on Combobox selection, I hope that is correct.I think is perfect, congrats But wait other expert, then we'll see your GUI in the first post I have a question for @Melba23, why:Relative to initial path (Default)Is equal to ONE and not ZERO? All other default values are zeros Edited February 10, 2013 by OliverA I'M QUIT FROM THIS FORUM! It was fun until it lasted, hope on my future way i can't find people that offend without any reason ( i was called lazy and parasitic, and everyone agreed...United we stand, divided we fall ) just for fun because don't have anything to do in the life, without knowing anything about the person who write, noone forced to post, noone forced to help.From the top of the from their very great superiority they not go down to my level, that people can not spread the knowledge but you have to learn by yourself. In what way? It's easy...just search on google For that people, wish you the best way, Oliver Astone Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2013 Author Moderators Share Posted February 10, 2013 OliverA,Why should they all default to the same value? I have always been entirely in agreement with the first phrase of this famous quote. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 11, 2013 Moderators Share Posted February 11, 2013 Are you sure you have the most recent version of the UDF from the first page of the thread. I checked this out this morning, and I did indeed still have the old version of the UDF. Thanks for the help "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 11, 2013 Author Moderators Share Posted February 11, 2013 JLogan3o13, Glad to hear it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted February 12, 2013 Share Posted February 12, 2013 Melba,johnmcloud,Do you want to have a go? If you do successfully modify it I will add a link to the first post. M23 If you think i need to add other changes i'll do it, no problem for me...you have help me a lot of time so at least partially I'll try to reciprocate Link to comment Share on other sites More sharing options...
z0iid Posted February 14, 2013 Share Posted February 14, 2013 This may not be very helpful (or solicited) - but... I used this udf to create a commandline tool for some of my fellow employees. It allows them to provide a path, file type, and location for csv file - then it spits out size, date created/modified. It works as designed - thanks. BUT... when searching very large file shares, with some folder paths that are very deep/long...more than 256 characters (that also happen to be cifs shares mounted on a novell server), I see that it chews up memory fairly rapidly, depending on file mask, while barely using any CPU. normally this wouldn't be a problem, but it doesn't end up paging to disk after memory runs out - so it will quit with a memory error before completing. Any thoughts on chunking out when results hit a user defined limit, that way it can have a sort of garbage collection feature? Also, I can't see a programmatic way to increase performance - but it seems like it could use more CPU. I would expect bad code in a nasty loop to use up 12.5% of my cpu (8 cores) (like some code i've written... :/ ) - and/or something working really hard to use that much as well. This never breaks 2% cpu on my box, and takes hours to search the same share I could search using a dir /s command in 20 minutes or less. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 14, 2013 Author Moderators Share Posted February 14, 2013 z0iid,I am not really prepared to work on the UDF to meet what seems to me to be a pretty specific requirement - sorry. But it was you who had a memory problem a while ago when running the UDF on shares - are you sure that you are not running into the same problem? I never did add that "no . and .." line into the release version - perhaps it might work again? As to the time it takes - that is just the CPU share it a single AutoIt thread gets. Perhaps you could try using ProcessSetPriority to increase the CPU time the thread gets while this UDF is running. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts