I am new to the communtity so first off a big HELLO and thanks for all your help which I have already got from searching these forums :o)
However I can not work this one out or find anything in forums. I am probabaly confused and missunderstanding the TYPE command but here goes....
(Oh, and I may be using the word 'collections' in the wrong context??)
I would have thought you should be able to have multiple collections of the same TYPE e.g. create a SOLDIER TYPE and then have a number of GOOD.SOLDIER's and loads of ENEMY.SOLDIER's. Both these collections use the same TYPE (and its associated fields) but should be distinct from each other???
But this does not appear to be the case (to me at least). All the commands for moving through collections actualy move you through all objects of that TYPE, so their is no way to isolate your GOOD soldiers and your ENEMY soldiers.
I have no problem with this 'limitation', it just means I would have to create a GOODSOLDIER TYPE and an ENEMYSOLDIER TYPE. But then why does Blitz3D allow me to create different collections of the same TYPE???
Why bother with
'Enemy.Soldier=New Soldier'
why not just have
'New Soldier'
and again why have
'Good = After Good'
instead of
'Next Soldier' or similiar
I think I must be missing something here or doing something wrong? Please can someone explain. I have included a bit of code I used to test this myself.
Thanks in advance, Rhy :o)
--------- MY EXAMPLE CODE ----------
Graphics 640,480
Type Test
Field Name$
End Type
Global BigCount=0
While Not KeyHit(1)
;add to first collection
For p=1 To 2
Primary.Test=New Test
Primary\Name=p
Next
BigCount=BigCount+2
;display first(?) collection
Primary.Test=First Test
For i=1 To BigCount
Print"Primary Name "+i+" = "+Primary\Name
Primary=After Primary
Next
Print
WaitKey()
;add to second collection
For s=100 To 200 Step 100
Secondary.Test=New Test
Secondary\Name=s
Next
BigCount=BigCount+2
;display second(?) collection
Secondary.Test=First Test
For i=1 To BigCount
Print"Secondary Name "+i+" = "+Secondary\Name
Secondary=After Secondary
Next
Print
WaitKey()
Wend
End
However I can not work this one out or find anything in forums. I am probabaly confused and missunderstanding the TYPE command but here goes....
(Oh, and I may be using the word 'collections' in the wrong context??)
I would have thought you should be able to have multiple collections of the same TYPE e.g. create a SOLDIER TYPE and then have a number of GOOD.SOLDIER's and loads of ENEMY.SOLDIER's. Both these collections use the same TYPE (and its associated fields) but should be distinct from each other???
But this does not appear to be the case (to me at least). All the commands for moving through collections actualy move you through all objects of that TYPE, so their is no way to isolate your GOOD soldiers and your ENEMY soldiers.
I have no problem with this 'limitation', it just means I would have to create a GOODSOLDIER TYPE and an ENEMYSOLDIER TYPE. But then why does Blitz3D allow me to create different collections of the same TYPE???
Why bother with
'Enemy.Soldier=New Soldier'
why not just have
'New Soldier'
and again why have
'Good = After Good'
instead of
'Next Soldier' or similiar
I think I must be missing something here or doing something wrong? Please can someone explain. I have included a bit of code I used to test this myself.
Thanks in advance, Rhy :o)
--------- MY EXAMPLE CODE ----------
Graphics 640,480
Type Test
Field Name$
End Type
Global BigCount=0
While Not KeyHit(1)
;add to first collection
For p=1 To 2
Primary.Test=New Test
Primary\Name=p
Next
BigCount=BigCount+2
;display first(?) collection
Primary.Test=First Test
For i=1 To BigCount
Print"Primary Name "+i+" = "+Primary\Name
Primary=After Primary
Next
WaitKey()
;add to second collection
For s=100 To 200 Step 100
Secondary.Test=New Test
Secondary\Name=s
Next
BigCount=BigCount+2
;display second(?) collection
Secondary.Test=First Test
For i=1 To BigCount
Print"Secondary Name "+i+" = "+Secondary\Name
Secondary=After Secondary
Next
WaitKey()
Wend
End