Jump to content

regress in Run-time errors on objects no longer fatal?


Go to solution Solved by Melba23,

Recommended Posts

Autoit 3.3.9.0 has Changed: Run-time errors on objects no longer fatal (execution of the script is not halted). 
And it work in 3.3.12.0
 
But in beta 3.3.13.19 script ended with error  The requested action with this object has failed
 
Or maybe this is Script Breaking Changes?
 

$a = ObjCreate('scripting.dictionary')
$a.add('x','a')
ConsoleWrite(@error & @CRLF)
$a.add('x','a')
ConsoleWrite(@error & @CRLF)
>Running:(3.3.12.0):D:\Program Files\AutoIt3\autoit3.exe "D:\Users\user\Desktop\AutoIt v3 Script (2).au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
0
-2147352567
+>18:03:05 AutoIt3.exe ended.rc:0
>Running:(3.3.13.19):D:\Program Files\AutoIt3\Beta\autoit3.exe "D:\Users\user\Desktop\AutoIt v3 Script (2).au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
0
"D:\Users\user\Desktop\AutoIt v3 Script (2).au3" (45) : ==> The requested action with this object has failed.:
$a.add('x','a')
$a^ ERROR
->18:03:28 AutoIt3.exe ended.rc:1
Link to comment
Share on other sites

Yeah, the change is intentional. Jon had a post about that some time ago giving explanation and basically redefining the word "stupid". However, I hope people that influence Jon these days will be smart, and more importantly eloquent, enough to make him reconsider the decision.

I also hope for peace in the world. How big are chances for that?

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

  • Moderators
  • Solution

Inververs,

Other than the intentional nature of the change, I completely refute the version of events in the post above - it is nothing more that the usual bitter and twisted personal attack we have come to expect from that member. :(>

Jon made a design decision - his privilege - and as a matter of fact there was a fair amount of opposition expressed. His argument was basically that AutoIt should not silently accept script errors and so hide their existence from the user. You can get round the problem very easily by creating your own simple error handler like this and registering it every time there might be a problem: ;)

$a = ObjCreate('scripting.dictionary')

; There might be a fatal error in the following code, so prepare for it
Template_COMErrorRegister()

$a.add('x', 'a')
ConsoleWrite(@error & @CRLF)
$a.add('x', 'a')
ConsoleWrite(@error & @CRLF)

; Fatal error section ends, so no further protection required
Template_COMErrorUnregister()

; ----------------------------------------------------------------------

Func Template_COMErrorRegister()
    Global $__g_oTemplateCOMErrorHandler = ObjEvent("AutoIt.Error", "Template_COMErrFunc")
EndFunc   ;==>Template_COMErrorRegister

Func Template_COMErrorUnregister()
    Global $__g_oTemplateCOMErrorHandler = 0
EndFunc   ;==>Template_COMErrorUnregister

Func Template_COMErrFunc()
    ; Do nothing, just check @error after suspect functions.
EndFunc   ;==>Template_COMErrFunc
In fact the change has already proved useful. We recently discovered by chance that scripting dictionary objects do not accept 64-bit keys - but as in the past AutoIt failed silently on the error, the user was not informed and so got an empty return when using _ArrayUnique. I rewrote the function to get around this problem and I have added an error handler like the one above to cope with the case of an Int64 being passed inadvertently as a key. :)

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

 

Link to comment
Share on other sites

  • Moderators

trancexx,

You have been warned before about making ad hominem attacks when commenting on AutoIt development. By all means disagree with decisions - as many did with the one under discussion - but remember that it was your decision to resign as a developer which means you now have no role in the development process. As you seem incapable of restraining your impulse to make it personal whenever you post rather than applying your undoubted talent to the benefit of the community you will be unable to do either for a while. :naughty:

Unfortunately this means that we all lose - but your actions leave little choice. You cannot expect to remain welcome in a community upon which you so often inflict your vitriolic attacks. :(>

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...