reffering to instance of a type

Blitz3D Forums/Blitz3D Beginners Area/reffering to instance of a type

Will(Posted 2005) [#1]
I have a type that stores all my graphics, called a GraphicsPile, and an instance of that is called TileGraphics, and is global. I want to keep a reference to it in some other types as I declare them, how can I make it so that I pass it a reference to TileGraphics and not just code in that it uses TileGraphics?


WolRon(Posted 2005) [#2]
I think you need to define better what it is that you are trying to achieve. Try writing some code. Do you mean something similar to this:?
Type GraphicsPile
  Field a
  Field b
  Field c
End Type

Global TileGraphics.GraphicsPile = New GraphicsPile

Type OtherType
  Field a
  Field b
  Field reference
End Type

othertypetypeinstance.OtherType = New OtherType

othertypetypeinstance\reference = TileGraphics



Stevie G(Posted 2005) [#3]
In the othertype example above you need to change the

field reference

to

field reference.GraphicsPile

for the above to work.

Cheers
Stevie


_PJ_(Posted 2005) [#4]
So, (and this really helps with my other issue...

If (providing the Type is specified as Global), the Field is superceded by .(instance), you can noominate and specify the particular instance anywhere else in your code/functions?


WolRon(Posted 2005) [#5]
If (providing the Type is specified as Global), the Field is superceded by .(instance), you can noominate and specify the particular instance anywhere else in your code/functions?
I don't know what you are asking but .(instance) is actually .(type)


big10p(Posted 2005) [#6]
Malice, I posted some code in your other thread, in case you haven't seen it already.


Will(Posted 2005) [#7]
Thanks, got it now


_PJ_(Posted 2005) [#8]
Great!!! Thanks Big10p, just seen it now!