c.haslam Posted June 10, 2015 Share Posted June 10, 2015 This is Melba23's ChooseFileFolder.au3.My test script is:#include "ChooseFileFolder.au3" Global $gInPath = @MyDocumentsDir & "\My Scans\" Local $ret = _CFF_Choose("Choose TIF files to be deleted", 300, 500, -1, -1, $gInPath, "*.tif", 1) MsgBox(0,"",$ret)It runs OK.This is an excerpt from a much longer script.The much longer script, which has the same call to _CFF_Choose(), abends at line 101 of File.au3:"F:\Program Files\AutoIt3\Include\File.au3" (101) : ==> Variable used without being declared.: Func _FileListToArrayRec($sInitialPath, $sMask = "*", $iReturn = 0, $iRecur = 0, $iSort = 0, $iReturnPath = 1) ^ ERRORSuggestions? Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2015 Moderators Share Posted June 10, 2015 c.haslam,From those snippets it is impossible to offer any constructive comment - as that looks like an Au3Check error there is every chance that the actual error is elsewhere. If you let me see the script that causes the problem I will try and locate 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...
c.haslam Posted June 10, 2015 Author Share Posted June 10, 2015 I tried this variant of the test code:Global $gInPath = @MyDocumentsDir & "\My Scans\" Local $ret = _CFF_Choose("Choose TIF files to be deleted", 300, 500, -1, -1, $gInPath, "*.tif", 1) MsgBox(0,"",$ret) #include "ChooseFileFolder.au3"This abended with:"F:\AutoIt scripts\ChooseFileFolder.au3" (277) : ==> Variable used without being declared.: If IsArray($g_aCFF_PreCheck) Then If IsArray(^ ERRORbut your code does define $g_aCFF_PreCheck. Strange!You are welcome to my script. Should I send it to you by PM, or post it here? Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2015 Moderators Share Posted June 10, 2015 c.haslam,That snippet fails because the #include directive appears in the code after the call to the function, so at the time the function is called the variable has not been declared. All include files should be at the top of the script so that the various declarations are in place before the UDF functions are first called. You need to remember that #include just inserts the whole of the included file at that point of the main script - and AutoIt requires variables to be declared before they are used - so placing the #include line later in the script risks having some required variable undeclared when first encountered.I would now hazard a guess that the same thing occurs in the other script.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...
c.haslam Posted June 10, 2015 Author Share Posted June 10, 2015 (edited) Unfortunately, your guess is incorrect: all #includes are at the top of my script:AutoItSetOption("MustDeclareVars", 1) AutoItSetOption("TrayIconDebug", 1) AutoItSetOption("WinTitleMatchMode", 0) ; match from the start #include "Constants.au3" #include "File.au3" #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <Misc.au3> #include <StructureConstants.au3> #include <GuiListView.au3> #include "ChooseFileFolder.au3"I verified that I am using the latest version of ChooseFileFolder.au3 by downloading and unzipping the version pointed to by your posting footer. The size and date-time are the same as on my PC.Neither Constants.au3 nor File.au3 are in my script directory. Neither are there, so these files are the ones supplied with AutoIt.Should I send my script to you by PM, or post it here? Edited June 10, 2015 by c.haslam Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2015 Moderators Share Posted June 10, 2015 c.haslam,If you wish to keep it confidential, by all means send it by PM - if not then just post 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...
c.haslam Posted June 10, 2015 Author Share Posted June 10, 2015 One never knows these days what might need to be confidential so I will PM it. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard 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