Types problem

Blitz3D Forums/Blitz3D Beginners Area/Types problem


nice but is a way to get lost with your types

better of checking each eg a.car b.car c.car



It's not a suggestion of how to handle types, it's a demonstration of LOCAL variables and GLOBAL variables, nothing more than that.

besides which referring to each type by an individual variable is inefficient, since they are all of the same type, looping through them is quicker, more memory efficient and less error prone.

i.e.
for n = 1 to 5
   a.car = new car
   a\x = n*10 ;or whatever
next

for a.car = each car
   print a\x
next


instead of:
a.car = new car
   a\x = 10
b.car = new car
   b\x = 20
c.car = new car
   c\x = 30
d.car = new car
   d\x = 40
e.car = new car
   e\x = 50

print a\x
print b\x
print c\x
print d\x
print e\x