Sign in to follow this  
Followers 0
ChangMinYang

How to check declared macro?

2 posts in this topic

Step 1.

AutoItSetOption( "OnExitFunc" , "ycmXDebugEnded" )
    ;default=OnAutoItExitoÝ÷ Ù+^§¨#¬¶¸vØb±«­¢+Ùչѥ½¸åµaEեР¤(á¥ÐåµaÕ¹ ¤ì±ÐìôQ¡¥Ì±¥¹½ÕÈÉɽÈÌäíU¹¥¹á¥Ñ
½Ìäì¸)¹Õ¹

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0