Jump to content

Recommended Posts

Posted (edited)

Hi

On a script im doing im using this after advice from guinness

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7

But often when i add functions from other people i get this error message

>Running AU3Check (1.54.22.0)  params:-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7  from:C:Program Files (x86)AutoIt3
C:UsersJezDesktopServicesServices Changer.au3(526,21) : WARNING: $hWnd: declared, but not used in func.
Func WM_NOTIFY($hWnd,
~~~~~~~~~~~~~~~~~~~~^
C:UsersJezDesktopServicesServices Changer.au3(526,28) : WARNING: $iMsg: declared, but not used in func.
Func WM_NOTIFY($hWnd, $iMsg,
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:UsersJezDesktopServicesServices Changer.au3(526,37) : WARNING: $wParam: declared, but not used in func.
Func WM_NOTIFY($hWnd, $iMsg, $wParam,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:UsersJezDesktopServicesServices Changer.au3 - 0 error(s), 3 warning(s)

Ive spent time trying to get rid of all the errors about functions not declared etc but i cant seem to get rid of these warnings.

Is there a way to stop it?

And when declaring the non declared varaibles should i just global every fault?

Edited by Chimaera
Posted (edited)

Sometimes variables need to be declared but aren't used, just like when intercepting Windows Messages, therefore use #forceref e.g. Example use can be seen in _GUICtrlListView_ClickItem amongst others.

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam

My advice isn't always the best, but since I've started using the additional parameters it's forced me to create code which is structured correctly.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

Oh i agree its an ass sometimes but i had no idea how many errors i was getting until i used it

Ill try ur suggestion thx

As far as the advice m8 ive never had any problems with your advice

EDIT

Yep thats got the bad boys, after i corrected the typo ;o)

Edited by Chimaera
Posted

After a while declaring variables will become second nature. Before #forceref was introduced the problem could be eradicated by setting the variable with itself e.g. $sVariable = $sVariable, but I would use #forceref as this is what it was designed for.

For those interested in the history >>

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...