Fractured

_FileListToArrayRec - "Invalid Include parameter"

4 posts in this topic

#1 ·  Posted

Im back! Tinkering with my search gui and tried to add another folder to the search. I add some of the changes that I learned of here and thought I had everything going, but....

I keep getting the "File List To Array Error", "Invalid Include parameter" when it tried to do the second folder...if tried a few changes but nothing seems to get me past it...I can see data flow into the arrays but nothing...splat!

;======================================================================================================================================
; File Search Function
;======================================================================================================================================
Func _DWGS($sSearch = "DWG")
    Local $aFileList[0], $aFileLista, $aFileListc
    GUICtrlSetData($idFileList,"")

        Local $sdSearchSL = StringLeft($sSearch, 3) 
        Local $sSourceFoldera = $g_sFilePatha & "\DWG" & $sdSearchSL
        Local $sSourceFolderc = $g_sFilePathc

    If FileExists($sSourceFoldera) = 0 Then
        MsgBox(4096, "File Path Error", "Folder : " & $sSourceFoldera & " does not exist.")
        Return ""
    EndIf

    If FileExists($sSourceFolderc) = 0 Then
        MsgBox(4096, "File Path Error", "Folder : " & $sSourceFolderc & " does not exist.")
        Return ""
    EndIf

        Local $sSearchMask = $sSearch & "?.*"
        
        Local $aFileLista = _FileListToArrayRec($sSourceFoldera, $sSearchMask & "*", 1, 1, 1, 2)
            _ArrayDisplay($aFileLista) ; Included to test if anyhting is going into $aFileListc
        Local $aFileListc = _FileListToArrayRec($sSourceFolderc, $sSearchMask & "*|*.cdr", 1, 1, 1, 2)
            _ArrayDisplay($aFileListc) ; Included to test if anyhting is going into $aFileListc

        _ArrayConcatenate($aFileList, $aFileLista, 1)
        _ArrayConcatenate($aFileList, $aFileListc, 1)
        
    Switch @error
        Case 1
             MsgBox(4096, "File List To Array Error", "Path not found or invalid")
             Return ""
        Case 2
            MsgBox(4096, "File List To Array Error", "Invalid Include parameter")
            Return ""
        Case 3
             MsgBox(4096, "File List To Array Error", "Invalid Exclude parameter")
             Return ""
        Case 4
            MsgBox(4096, "File List To Array Error", "Invalid Exclude_Folders parameter")
            Return ""
        Case 5
            MsgBox(4096, "File List To Array Error", "Invalid $iReturn parameter")
            Return ""
        Case 6
            MsgBox(4096, "File List To Array Error", "Invalid $iRecur parameter")
            Return ""
        Case 7
            MsgBox(4096, "File List To Array Error", "Invalid $iSort parameter")
            Return ""
        Case 8
            MsgBox(4096, "File List To Array Error", "Invalid $iReturnPath parameter")
            Return ""
        Case 9
            MsgBox(4096, "File List To Array Error", "No files/folders found")
            Return ""
    EndSwitch

Return _ArrayToString($aFileList, "|", 1)

EndFunc

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Moved out of Examples forum and into General Help and Support. Please be aware of where you post in the future.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

ahh sorry...thought I was in general help...miss clicked the mouse

Share this post


Link to post
Share on other sites

#4 ·  Posted

Fractured,

How about you doing some errorchecking to try and help us help you. If you get an error telling you that there is an "Invalid Include parameter", why not add a ConsoleWrite or MsgBox command immediately before the _FileListToArrayRec call and see exactly what parameter you are passing to the function? Then you might see why you get this error.

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now