&Class.var ?
Posted: 10 Feb 2016, 21:06
I'm still struggling through some basics here.. Please tell me where I have something wrong.
For most purposes, it seems that I can treat "Class.var" and "var" as interchangeable, once "Class.var" has been assigned a value.
To avoid possible conflicts between instance variables and base-class static variables of the same name, I have adopted the habit of always using "base.var" and "this.var" instead of just "var" even where "var" would work. I use unqualified names for function-local variables that are not intended to be shared among methods.
I tried calling a DLL with an argument &base.var, expecting it to change the "var" declared as static in base.
It did not change base.var.
So I used &localvar, and after the call did base.var := localvar. That fixed the problem, but it feels a bit awkward.
Is there a syntax for properly taking the address of base.var?
Or did I mis-interpret my results?
Any clarifications would be appreciated.
For most purposes, it seems that I can treat "Class.var" and "var" as interchangeable, once "Class.var" has been assigned a value.
To avoid possible conflicts between instance variables and base-class static variables of the same name, I have adopted the habit of always using "base.var" and "this.var" instead of just "var" even where "var" would work. I use unqualified names for function-local variables that are not intended to be shared among methods.
I tried calling a DLL with an argument &base.var, expecting it to change the "var" declared as static in base.
It did not change base.var.
So I used &localvar, and after the call did base.var := localvar. That fixed the problem, but it feels a bit awkward.
Is there a syntax for properly taking the address of base.var?
Or did I mis-interpret my results?
Any clarifications would be appreciated.