MvGulik Posted December 1, 2011 Share Posted December 1, 2011 You can use a "_Adlib_timer(111)" call after a "AdlibRegister('_Adlib_timer')".But you can't use a "_Adlib_timer(111)" call before using the "AdlibRegister('_Adlib_timer')"Odd ... O well.#AutoIt3Wrapper_Run_Au3Check=y #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y ;~ #AutoIt3Wrapper_AU3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 _Adlib_timer(111) ;; triggers AU3Check errors. AdlibRegister('_Adlib_timer') ;~ _Adlib_timer(111) ;; not triggering AU3Check errors. AdlibUnRegister('_Adlib_timer') Func _Adlib_timer($parm1 = 1) #forceref $parm1 EndFunc #cs >Running AU3Check (1.54.19.0) from:C:\...\AutoIt3 || >Running AU3Check (1.54.22.0) from:C:\...\AutoIt3\beta D:\...\TEST.au3(5,29) : ERROR: _Adlib_timer() called with wrong number of args. AdlibRegister('_Adlib_timer') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\...\TEST.au3(4,17) : REF: definition of _Adlib_timer(). _Adlib_timer(111) ~~~~~~~~~~~~~~~~^ D:\...\TEST.au3(7,31) : ERROR: _Adlib_timer() called with wrong number of args. AdlibUnRegister('_Adlib_timer') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\...\TEST.au3(4,17) : REF: definition of _Adlib_timer(). _Adlib_timer(111) ~~~~~~~~~~~~~~~~^ D:\...\TEST.au3 - 2 error(s), 0 warning(s) !>11:03:19 AU3Check ended.rc:2 #ce(posting this resolve it for me.) "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
BrewManNH Posted December 1, 2011 Share Posted December 1, 2011 Adlib functions can't have parameters, which I think might be the problem here. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
MvGulik Posted December 1, 2011 Author Share Posted December 1, 2011 Think your statement is ambiguous.- The Adlib-Register part can't have any function parameter.The function definition itself can have parameter. (That the parameters of a function are not used when a function is called by a Adlib-call (or other callbacks) is something else.) "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
BrewManNH Posted December 1, 2011 Share Posted December 1, 2011 I started a topic on this not long ago in regards to an OnEvent function with parameters which was throwing errors because of it. Yes it will work with a function with parameters, but you will get error messages from AU3Check because of it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
MvGulik Posted December 1, 2011 Author Share Posted December 1, 2011 (edited) Erm ... yea. From Au3Check (code) point of view it probably makes perfect sens. But that don't changes the fact that from AutoIt's point of view its legit code. Lets leave it at that. Edited December 1, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
BrewManNH Posted December 1, 2011 Share Posted December 1, 2011 The fact is, if you have an Adlib or OnEvent function with parameters, those parameters can't be used in the function, so they're basically just errors waiting to happen. You'll get an undeclared variable error if you try to use it, and if you try to declare it in the function you'll be told it's already declared. I think that AU3Check telling you that you made a mistake in your code is a good indication that you made a mistake somewhere in your code in this instance. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 1, 2011 Moderators Share Posted December 1, 2011 Hi,I am sure you all realise this, but if you want to use the same function in an Adlib and called direct from the script without causing Au3Check to throw a fit, you can do it by using a wrapper function like this: _Adlib_timer_Basic(111) ; Call the basic function AdlibRegister('_Adlib_timer', 1000) ; Call the wrapper function $iBegin = TimerInit() Do Sleep(10) Until TimerDiff($iBegin) > 5000 AdlibUnRegister('_Adlib_timer') ; Wrapper function - no parameters Func _Adlib_timer() _Adlib_timer_Basic() EndFunc ; Basic function - with parameters Func _Adlib_timer_Basic($parm1 = 1) ; Here is your function ConsoleWrite(@SEC & " - " & $parm1 & @CRLF) EndFuncM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted December 1, 2011 Share Posted December 1, 2011 That's what I did when I found out about the parameter issue, used another function for the OnEvent function that calls the main function. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now