Bug? Using Variable name CS leads to warning

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Bug? Using Variable name CS leads to warning

27 Nov 2018, 07:02

Within my class I have a method, doing something like this

Code: Select all

class X {
	;....
	methodA() {
		cs := functionXYZ()
	}
	;....
}
Using this class, I get a warning (having #warn enabled):

Code: Select all

---------------------------
test.ahk
---------------------------
Warning in #include file ".........\MyClass.ahk":
     Class may be overwritten.

Specifically: CS

	Line#
	...
	248: CounterCurr := 0
--->	250: CS := CallStack(deepness := thiscalldepth+20)
	252: Loop tokens.Length()
	....
What does this message mean? Nowhere else within my code anything is named "CS" (espacially no class named "CS")....

Renaming CS to anything else (for example cst) the code runs without this warning. Within my code cs is written in lowercase letters - whereas in the warning box it's written in uppercase ....

Is CS a special internal AHK-variable, which is not to used by user? Is this a bug in AHK?

Runnning AHK 2.0-a100-52515e2
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Bug? Using Variable name CS leads to warning

01 Dec 2018, 08:42

Can you provide something reproducable?

Cheers.
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Bug? Using Variable name CS leads to warning

03 Dec 2018, 00:29

Helgef wrote:
01 Dec 2018, 08:42
Can you provide something reproducable?
It's deeply embedded in my class hierarchy currently - I've got to isolate the problem. I'll give it a try as soon as I've got some spare time .... :?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Bug? Using Variable name CS leads to warning

12 May 2019, 20:17

It is most likely a legitimate warning. If you haven't already worked it out, you can probably verify by using ListVars inside methodA; if it has no local variable named "cs", you are definitely assigning to a super-global variable (i.e. a class).

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Archimede, niCode, songdg and 38 guests