Getting a type based on a value(fast)?
Blitz3D Forums/Blitz3D Beginners Area/Getting a type based on a value(fast)?
| ||
Is there any other way than to do this other than slow for each loop? |
| ||
You can use an array of types, like so .Type MyType field x#, y#, z# End Type Dim MYarray.MyType(100) For l = 0 to 100 MYarray(l) = new MyType MYarray(l)\x = blah MYarray(l)\y = blah Next [\code] To get the y value for the 53rd instance use: [code] Print MYarray( 52 )\y Or make use of object and handle. It depends on what you're doing really? |
| ||
Ok, basically what i am doing is I create an object, then i need to find it later on, but I don't know where i put it in the first place(like dynamically creating them) I will look into object and handle |
| ||
Or use something like a Map. |