Modify ↓
      
        Opened 11 years ago
Closed 11 years ago
#2818 closed Feature Request (Rejected)
OnAutoItExitRegister - Remarks and Example - proposal
| Reported by: | mLipok | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | Documentation | |
| Version: | Severity: | None | |
| Keywords: | Cc: | 
Description
Please consider supplementing Remark for information regarding the use of the function in which the parameters are used. This can cause error messages 'Variable used without Declaring'
In addition, I attach example workaround. Please consider placing it in HelpFile.
#include <MsgBoxConstants.au3>
OnAutoItExitRegister(MyExitFunc)
OnAutoItExitRegister(ExitWrapper)
; first normal function call - to check if Local is defined
MyExitFunc()
Sleep(1000)
; last function call - 'OnExit'
; Remark first be caled ExitWrapper
Exit
Func MyExitFunc($vTest = -1)
	Local Static $iCount = 1
	MsgBox($MB_SYSTEMMODAL, "Exit test #" & $iCount, "IsDeclared('vTest') " & @CRLF & IsDeclared('vTest'))
	$iCount += 1
EndFunc   ;==>MyExitFunc
Func ExitWrapper()
	MsgBox($MB_SYSTEMMODAL, '', 'Now exiting using ExitWrapper()')
	MyExitFunc()
EndFunc
    Attachments (1)
Change History (3)
Changed 11 years ago by mLipok
comment:1 Changed 11 years ago by Melba23
comment:2 Changed 11 years ago by Melba23
- 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.
Note: See
        TracTickets for help on using
        tickets.
    

OnAutoItExitRegister is designed as a "one-stop" call for UDFs that need to clear up after they are used. If a user wants to have several dependent OnExit functions, then they should arrange them in a single wrapper function which is then passed for action on AutoIt exit. The problem is for the user to resolve, not AutoIt.
M23