I tried the upper most example and changed the name in the last For-loop to this:
I think Sintetik was asking: why should you give a name to the type, as it doesn't matter what name you give?
In my example, the variable "a" (or type instance) didn't exist or doesn't get declared.
But Blitz doesn't give me an error on it.
So you could create this program:
And it still does work.
In my opinion, there no need the give a type instance a name, like this:
Why not just do:
And use this routine to run through them:
This could make more sense (to me anyway).
For a.sprite= Each sprite Print a\LOCY Next
I think Sintetik was asking: why should you give a name to the type, as it doesn't matter what name you give?
In my example, the variable "a" (or type instance) didn't exist or doesn't get declared.
But Blitz doesn't give me an error on it.
So you could create this program:
Type SPRITE Field LOCX Field LOCY Field CURRENTFRAME Field MAXFRAME End Type For temp = 1 To 5 cats.sprite = New sprite cats\LOCX = Rand(100) cats\LOCY = Rand(200) cats\CURRENTFRAME= Rand(1,8)-1 cats\MAXFRAME= 8 Next For a.sprite= Each sprite Print a\LOCY Next
And it still does work.
In my opinion, there no need the give a type instance a name, like this:
cats.sprite = New sprite
Why not just do:
New sprite
And use this routine to run through them:
For Each sprite Print sprite.LOCY Next
This could make more sense (to me anyway).