lucid,
Many are in favor of using Object/Handle Functions to manage types and access them instantly. However, they are not documented and probably for good reason. I would like to encourage using an array of types.
You can develop a simple or complex ID management system with an array of types. The advantage of assigning your own IDs is that you has complete control over the objects at design time, unlike Handles which are assigned at runtime.
For example, I'm creating a large RPG game level with lots of triggers that activate specific events and game objects (ie, doors, platforms, etc). All triggers, doors, platforms etc have their own specific ID. Thus, I can easily assign trigger(1) to door(4), trigger(2) to platform(9) within my level editor or script.
Many are in favor of using Object/Handle Functions to manage types and access them instantly. However, they are not documented and probably for good reason. I would like to encourage using an array of types.
Dim objID.obj(256)There is slightly more setup required, but, benefits are great.
You can develop a simple or complex ID management system with an array of types. The advantage of assigning your own IDs is that you has complete control over the objects at design time, unlike Handles which are assigned at runtime.
For example, I'm creating a large RPG game level with lots of triggers that activate specific events and game objects (ie, doors, platforms, etc). All triggers, doors, platforms etc have their own specific ID. Thus, I can easily assign trigger(1) to door(4), trigger(2) to platform(9) within my level editor or script.
Type obj Field ID% Field property1% End Type Dim objID.obj(256) this.obj=New obj this\ID%=1 this\property1%=something objID.obj(this\ID)=thisEven if one uses Object/Handle, some form of ID management is required for complex interactivity.