acces this global in the "extended" type

BlitzMax Forums/BlitzMax Beginners Area/acces this global in the "extended" type

Abomination(Posted 2006) [#1]
SuperStrict

Type Go
	Global MaxGadgets:Int=256
	Global DrawBack:Int[MaxGadgets]
End Type

Type Sys Extends Go	
	Global DrawIt:Int[Go.MaxGadgets]
	Function test:Int()
		maxgadgets:+1
	End Function
	Global DrawBuffer:Int[MaxGadgets]'<--------
End Type

at the arrow I get an error saying: identifier "Maxgadgets" not found.
Why? Isn't Sys actualy a Go-type?


GfK(Posted 2006) [#2]
Shouldn't it be Int[Go.MaxGadgets]?


Abomination(Posted 2006) [#3]
well, that worked (in the same type (sys), three lines up)
But Why?


FlameDuck(Posted 2006) [#4]
But Why?
Because it's a static reference?


H&K(Posted 2006) [#5]
That doesnt explain it. Maxgadgets is in the namespace go, which is extended into the name space SYS.

So because its static, "SYS.Maxgadgets" or "Go.Maxgadgets" or simply just "Maxgadgets" should all work.

@Abom, because I use BLide, I always use the first or second of the above. (TExtenedType. or TBaseType. ) then the field popup, errr popsup. So maybe it supposed to be like that. ( I aways put self infrount of fields as well)

What I think this might be is "When" is the global for the type allocated. I think its allocated 1)When its first referenced or 2)When the first new of that type is encounted. And so I think this is the problem.