Exception.What when the script is compiled

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
bourdin07
Posts: 36
Joined: 23 Jun 2019, 12:57

Exception.What when the script is compiled

Post by bourdin07 » 19 Aug 2019, 04:51

When the script is compiled Exception(msg).What return only negative integer.
But not compiled it work properly

Is is possible to get current function when the exception is thrown in compiled script (without explicitly write A_ThisFunc)?
Last edited by bourdin07 on 19 Aug 2019, 04:56, edited 1 time in total.

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Exception.What when the script is compiled

Post by Helgef » 19 Aug 2019, 04:56

exception wrote: If What is omitted, it defaults to the name of the current function or subroutine. Otherwise it can be a string or a negative offset from the top of the call stack. For example, a value of -1 sets Exception.What to the current function or subroutine and Exception.Line to the line which called it. However, if the script is compiled or the offset is invalid, What is simply converted to a string.
my bold

Cheers.

bourdin07
Posts: 36
Joined: 23 Jun 2019, 12:57

Re: Exception.What when the script is compiled

Post by bourdin07 » 19 Aug 2019, 07:26

Mybad

I have Exception.what function name properly when throw Exception(msg)

But when I try to loop Exception offset, what is negative integer

Post Reply

Return to “Ask for Help (v2)”