acces this global in the "extended" type
BlitzMax Forums/BlitzMax Beginners Area/acces this global in the "extended" type
| ||
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? |
| ||
Shouldn't it be Int[Go.MaxGadgets]? |
| ||
well, that worked (in the same type (sys), three lines up) But Why? |
| ||
But Why? Because it's a static reference? |
| ||
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. |