Jump to content

How to check declared macro?


Recommended Posts

see this trac ticket for this issue

Local or Global declarations can ignore OnAutoItExit function

Ticket #810 (closed Bug: Fixed)

http://www.autoitscript.com/trac/autoit/ticket/810

in OnEvent mode some macros are also only available under certain conditions (@GUI_DragID etc.)

you could use Execute()

Edit: clarified above statement that other macros are also conditional, not that exit macros are only conditional in OnEvent mode)

Opt( "OnExitFunc" , "ycmXDebugEnded" )

;1/
;OnAutoitExit function NOT called
;Local $Value = ycmXQuit()

;2/
;OnAutoitExit function called
;Local $Value
;$Value = ycmXQuit()

;3/
;Execute() -  returns "" with @error set not to 0 if macro does not exist
ycmXDebugEnded()

Func ycmXQuit()
    Exit 4
EndFunc

Func ycmXDebugEnded()
    Beep(1000,5)
    ConsoleWrite('!@ExitMethod = ' & Execute("@ExitMethod") & @crlf & '>Error code: ' & @error & @crlf) 
    ConsoleWrite('!@exitCode = ' & Execute("@exitCode") & @crlf & '>Error code: ' & @error & @crlf) 
EndFunc
Edited by rover

I see fascists...

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...