From what I understand, you need an Hash Table, which is a table where the elements can be stored using a key, and this key could be either a number or a string.
With an Hash Table you could something like Turn("TOTO"), and it will pick from the table the object which is connected to the word "TOTO".
Such thing is not possible with the current type structure; even using Object and Handle, you are limited because the name of your entity should be a number, which represent the handle of the type element.
But you could build up an hash table using a pivot as property container, and the very good SetProperty and GetProperty functions by Ken Lynch, which you find in the code archive:
http://www.blitzbasic.com/codearcs/codearcs.php?code=820
With that simple piece of code - IMO a gem of programming - you can set and get property values using a property name.
For example, you could do something like:
SetProperty mypropertybag, "TOTO", type_element
Later, you can do something like:
type_element = GetProperty mypropertybag, "TOTO"
The trick here is to use a pivot as propertybag, and give to the property "TOTO" the value of the created type element.
Once you have retrieved the type element, you use Object to access to it, and you're done. I'm not sure, but you could also do something like:
temp.mytype = GetProperty propertybag, "TOTO"
print temp\whatever
Hope this has sense for you,
Sergio.
P.S.
If you just need to access the entity, and not the type element, then it would easier:
With an Hash Table you could something like Turn("TOTO"), and it will pick from the table the object which is connected to the word "TOTO".
Such thing is not possible with the current type structure; even using Object and Handle, you are limited because the name of your entity should be a number, which represent the handle of the type element.
But you could build up an hash table using a pivot as property container, and the very good SetProperty and GetProperty functions by Ken Lynch, which you find in the code archive:
http://www.blitzbasic.com/codearcs/codearcs.php?code=820
With that simple piece of code - IMO a gem of programming - you can set and get property values using a property name.
For example, you could do something like:
SetProperty mypropertybag, "TOTO", type_element
Later, you can do something like:
type_element = GetProperty mypropertybag, "TOTO"
The trick here is to use a pivot as propertybag, and give to the property "TOTO" the value of the created type element.
Once you have retrieved the type element, you use Object to access to it, and you're done. I'm not sure, but you could also do something like:
temp.mytype = GetProperty propertybag, "TOTO"
print temp\whatever
Hope this has sense for you,
Sergio.
P.S.
If you just need to access the entity, and not the type element, then it would easier:
acube = createcube() SetProperty propertybag,"TOTO",acube . . ;want to turn the cube "TOTO" ? entity = GetProperty propertybag, "TOTO" turnentity entity,1,1,1