Opened 15 years ago
Closed 15 years ago
#1762 closed Bug (No Bug)
With ... EndWith crashes instead of Error.
| Reported by: | Kip | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | with object | Cc: |
Description
$oObject.MemberDoesntExist() ; results in:
; ==> The requested action with this object has failed.:
; as expected.
With $oObject
.MemberDoesntExist() ; crashes
EndWith
Attachments (0)
Change History (4)
follow-up: 2 comment:1 by , 15 years ago
comment:2 by , 15 years ago
This is an old report, but it was still marked as 'new', so meh...
Replying to MrCreatoR <mscreator@…>:
No crash for me:
$oObject = ObjCreate("Scripting.FileSystemObject") With $oObject .MemberDoesntExist() EndWith
I get the same thing as the OP with *your code*:
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Username\Desktop\New AutoIt v3 Script (2).au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>14:59:58 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86) >Running AU3Check (1.54.19.0) from:C:\Program Files\AutoIt3 +>14:59:58 AU3Check ended.rc:0 >Running:(3.3.6.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Username\Desktop\New AutoIt v3 Script (2).au3" C:\Documents and Settings\Username\Desktop\New AutoIt v3 Script (2).au3 (4) : ==> The requested action with this object has failed.: .MemberDoesntExist() .MemberDoesntExist()^ ERROR ->15:00:03 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 7.280
But, I've always gotten an error like this when using invalid members/methods and assumed you just don't do it unless you have an error handler.
No crash with this:
$oMyError = ObjEvent ( "AutoIt.Error", "MyErrFunc" )
$oObject = ObjCreate("Scripting.FileSystemObject")
With $oObject
.MemberDoesntExist()
EndWith
Func MyErrFunc()
ConsoleWrite("-> AutoItCOM Test"&@CRLF&"-> We intercepted a COM Error !"&@CRLF& _
"-> err.number is: "&@TAB&hex($oMyError.number,8)&@CRLF& _
"-> err.scriptline is: "&@TAB&$oMyError.scriptline)
Endfunc
So, not to be mean, but: I'm not really sure what the issue is, since I thought that's what the COM Error Handler was for - handling COM Errors.
comment:3 by , 15 years ago
Ticket can be closed - I used round brackets where I should have used [].
comment:4 by , 15 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
As said in the other BUG report from you. Stop posting issues here before posting your issues in the forum to see whether it is a pilot error.

No crash for me:
$oObject = ObjCreate("Scripting.FileSystemObject") With $oObject .MemberDoesntExist() EndWith