Something about Types

Blitz3D Forums/Blitz3D Programming/Something about Types

KuRiX(Posted 2005) [#1]
There are something about types i don't understand. When i declare a type

type mytype

end type

then i can create new instances:

collection1.type = new mytype
collection2.type = new mytype

Althought there are two different collections, when i iterate using for ... each, i think i iterate through all the mytype objects, never mind where they are...

If this is true, how to have two separate collections of my type to iterate through???

Thanks...


Jay Kyburz(Posted 2005) [#2]
im not an expert, but i think you have to simply create two types. If you didn't want to do this you could place the type instances in an array and iterate this, OR perhaps write your own linked list code (easy)


WolRon(Posted 2005) [#3]
Hakea is correct.
You might also try adding a special field to the type which will help identify the type. Then only work on the types that match the identity. If, however, you are trying to gain speed by NOT looping through them all, then you could try Hakea's ideas.


KuRiX(Posted 2005) [#4]
Ok, Thanks. It was only to know if it was my fault or a Blitz3d limitation.

I think that normally you use a type for one thing only. The only problem is that i don't see that kind of work very intuitive.

Of course Hakea's ideas are good.

Well, Thanks again and Bye!