You can't do it that way, you must use an array.
This code shows how to use an array in order to store data of different objects :
Sync On
Sync Rate 0
rem type declaration
Type TObject
objType As Integer
xPos As Float
yPos As Float
zPos As Float
height As Float
EndType
rem this will create an empty array of 'TObjects'
Dim object(0) As TObject
rem ceration of 3 objects
newObject(1, 0.0,0.0,0.0, 1.0)
aSpecificObject = newObject(2, 1.0,0.0,0.0, 8.0)
newObject(1, 8.0,2.0,5.0, 4.0)
Do
Cls
objCount = Array Count(object(0))
Text 0,0, str$(objCount)+" objects :"
rem Printing information about all our objects
For o = 1 To objCount
Text 10,o*14, "Object "+str$(o)+" (type "+str$(object(o).objType)+") position : "+str$(object(o).xPos)+", "+str$(object(o).yPos)+", "+str$(object(o).zPos)
Next o
rem Printing information about a specific object
Text 450, 0, "object "+str$(aSpecificObject)+" height is "+str$(object(aSpecificObject).height)
Sync
Loop
rem this function creates a new object and returns its number
Function newObject(objType As Integer, xPos As Float, yPos As Float, zPos As Float, height As Float)
Array Insert At Bottom object(0) ` This command adds a new element on the array
ID = Array Count(object(0)) ` Here, we get the number of this element
object(ID).objType = objType
object(ID).xPos = xPos
object(ID).yPos = yPos
object(ID).zPos = zPos
object(ID).height = height
EndFunction ID