Something about Types
Blitz3D Forums/Blitz3D Programming/Something about Types
| ||
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... |
| ||
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) |
| ||
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. |
| ||
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! |