Modify

Opened 11 years ago

Closed 8 years ago

#3000 closed Feature Request (Rejected)

scriptline

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: scriptline Cc:

Description

When I don't set my own com error function and an error occurs the script line number is returned, is it possible to return script line number also when I set my function because currently the returned value is -1.

Attachments (0)

Change History (8)

comment:1 by TicketCleanup, 11 years ago

Version: 3.3.12.0

Automatic ticket cleanup.

comment:2 by J-Paul Mesnage, 11 years ago

not sure to understand can you a repro script
Thanks

comment:3 by anonymous, 11 years ago

$oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")

Func _ErrFunc($oError)
    $oError.scriptline ; This returns -1 when script is compiled.
EndFunc

When I don't use my com error handler the script line number is returned in the error message even when the script is compiled.

comment:4 by mLipok, 11 years ago

And what you are expect ?
If you want to see a proper Line Number in compiled script
then you must use Au3Stripper.exe

- Added #Au3Stripper_Parameters Parameter:
        - /rsln -> Replace @ScriptLineNumber with the actual line number for source debug purposes with compiled scripts.

btw.
next time try to ask on the forum

comment:5 by anonymous, 11 years ago

I expect to return line number like in the default error message.

comment:6 by mLipok, 11 years ago

in

ObjEvent(..

I use example from HelpFile

and in Au3.3.10.2 and Au3.3.13.19

I get:

ObjEvent.au3 (35) : ==> COM Error intercepted !
	err.number is: 		0x80020006
	err.windescription:	Nieznana nazwa.

	err.description is: 	
	err.source is: 		
	err.helpfile is: 	
	err.helpcontext is: 	
	err.lastdllerror is: 	0
	err.scriptline is: 	35
	err.retcode is: 	0x00000000

And in helpFile you can read:

@ScriptLineNumber Line number currently being executed. Useful for debug statements such as the calling line number for a function. (Not significant in compiled scripts)

So it works but remember: "(Not significant in compiled scripts)"
And this rule is also for ObjEvent.

comment:7 by anonymous, 11 years ago

Ok nevermind, looks like custom error handling won't be useful for me anyway. For me it returns -1, are you sure it is compiled script?

comment:8 by J-Paul Mesnage, 8 years ago

Resolution: Rejected
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.