#Warn with Gdip variable clash Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ahketype
Posts: 191
Joined: 27 Oct 2016, 15:06
Location: Yorkshire, UK

#Warn with Gdip variable clash

31 Jan 2022, 19:22

Hi, I've been using Gdip.ahk library and writing my code by hacking examples from @tic. These call the library with many of the same variable names as are used by the functions in Gdip itself.

Should I be worried when I put #Warn in my code that I get lots of error warnings about variables I'm using that are also in Gdip? These include things like pToken, hBitmap, pBitmap and G, from calls to the library, and also a bunch of common variable names like x, y, size and so on.

I began to rename them, and then got reports that these variables weren't assigned (unless I just screwed up the editing; I don't think so)!

I wonder if this is a general misuse of variables on my part - should I be declaring variables more specifically as global or local or something?

Or should I just take #Warn out again and forget it, since it's all be working just fine! :thumbup:

Cheers
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: #Warn with Gdip variable clash  Topic is solved

31 Jan 2022, 19:24

Yes, you can declare them, explained here: #Warn. Alternatively, remove the #Warn directive.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: #Warn with Gdip variable clash

31 Jan 2022, 19:28

You can still use #Warn, but just disable certain warnings (see #Warn docs).

Warnings are just potential errors - obviously the creators of the Gdip library didn't care to use #warn, or initializing variables. But these are probably no errors, just uninitialized variables.
But of course, you can also initialize all variables, if you prefer.
ahketype
Posts: 191
Joined: 27 Oct 2016, 15:06
Location: Yorkshire, UK

Re: #Warn with Gdip variable clash

31 Jan 2022, 19:35

Ahem, sorry, I don't know why I didn't look it up! :roll: Thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 379 guests