Jump to content
c.haslam

ChooseFileFolder.au3 abends

Recommended Posts

c.haslam

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)
^ ERROR

Suggestions?


Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Share this post


Link to post
Share on other sites
Melba23

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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
c.haslam

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(^ ERROR

but 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

 

Share this post


Link to post
Share on other sites
Melba23

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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
c.haslam

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 by c.haslam

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Share this post


Link to post
Share on other sites
Melba23

c.haslam,

If you wish to keep it confidential, by all means send it by PM - if not then just post it.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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
c.haslam

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

 

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

×