Jump to content

Recommended Posts

Posted

Hello, just stumbled across this behaviour while I was working on my project.

I am getting a "<function> called with wrong number of args" on a GUICtrlSetOnEvent line, the <function> as far as I can see accepts only 1 optional argument so it would just work fine with a GUICtrlSetOnEvent callback. The error surfaced when I add code which called the <function> with a single argument... it was working without any errors before that.

Here is the actual code (you can download the repository as zip and run it out of the box to get the error), the <function> is GUI_BridgeHandler and this is my SciTE Output:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "E:\Projects\AutoIt\ProxAllium\ProxAllium.au3" /UserParams    
+>18:53:37 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0   Keyboard:00000409  OS:WIN_81/  CPU:X64 OS:X64  Environment(Language:0809)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\TheDcoder\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\TheDcoder\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.3)  from:C:\Program Files (x86)\AutoIt3  input:E:\Projects\AutoIt\ProxAllium\ProxAllium.au3
"E:\Projects\AutoIt\ProxAllium\ProxAllium.au3"(127,43) : error: GUI_BridgeHandler() called with wrong number of args.
    GUICtrlSetOnEvent(-1, "GUI_BridgeHandler")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"E:\Projects\AutoIt\ProxAllium\ProxAllium.au3"(103,42) : REF: definition of GUI_BridgeHandler().
    GUI_BridgeHandler($g_idTrayOptionBridges)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\Projects\AutoIt\ProxAllium\ProxAllium.au3 - 1 error(s), 0 warning(s)
!>18:53:37 AU3Check ended. Press F4 to jump to next error.rc:2
+>18:53:38 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.273

Needless to say it works fine when I run it directly without Au3Check :)

Thanks for the responses in advance!

P.S Sorry for the thread's title, couldn't think of anything else.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

I think I have figured it out, Au3Check was using the new call to GUI_BridgeHandler as a reference to the syntax instead of the Func declaration so it might have thought the 1 argument may have been required. I managed to fix the error by using Call to call the function :).

Is this some kind of bug? Can anything be done to improve the situation? I would like to know @Jos's opinion on this :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

  • Developers
Posted

yea probably, It is also fixed by moving the Func Tray_HandleBridgeOption()  after the Func GUI_BridgeHandler($iCtrlID = Default).

With the changes made in AutoIt3 around the special function definitions we really opened a can of worms for au3check. 
I wish we had somebody around that really understands how it all works which is certainly not me. :)

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

I don't really understand what you mean by special functions but the Call function is certainly a though nut to crack :D

Can't really complain, Au3Check is a wonderful program and a complex beast, one can expect it to have some quirks here and there.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

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
×
×
  • Create New...