Modify

Opened 9 years ago

Closed 6 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 Changed 9 years ago by TicketCleanup

  • Version 3.3.12.0 deleted

Automatic ticket cleanup.

comment:2 Changed 9 years ago by Jpm

not sure to understand can you a repro script
Thanks

comment:3 Changed 9 years ago by anonymous

$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 Changed 9 years ago by mLipok

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 Changed 9 years ago by anonymous

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

comment:6 Changed 9 years ago by mLipok

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 Changed 9 years ago by anonymous

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 Changed 6 years ago by Jpm

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.