Why you should name types?

Blitz3D Forums/Blitz3D Beginners Area/Why you should name types?

It helps to think of the variable name you give to an instance of a type as a pointer to that instance, and not the instance itself. If you re-assign that variable to a different instance (which is what you're doing when you do a For..Each) the original instance doesn't go away. Alternately, if you're creating an instance that you want to keep tabs on (for example, a special Player sprite), giving it its own unique variable name will allow you to do that.

You can also just copy these pointers from one variable to another, which is sometimes very useful. Also, pointers can point to no instance at all ("Null"). Let's say you want to find the sprite with the lowest Y coordinate:
Lowest.Sprite = Null
For Spr.Sprite = Each Sprite
  If (Lowest = Null)
    Lowest = Spr
  Else If (Spr\Y < Lowest\Y)
    Lowest = Spr
  End If
Next


"Lowest" will now point to the lowest sprite, or it will be Null if there are no sprites.

I realize I'm kind of rambling here.. just pointing out some of the things about Types that escaped me for a long time.