I defined an array of user type with 99 elements
and i filled 10 of them, but not all:
now i want to iterate through the initalized ones, but it looks like the loop iterates through all 99:
does this mean, that all 99 elements are initialized from the first moment?
As a list is also not possible with user defined types... is there are chance to only iterate through the 10 defined?
B4X:
Type MusicEventTyp(SoundNr As Int, Volume As Float)
Private Music(99) As MusicEventTyp
B4X:
...
Music(9)= Init(6, 0.9)
...
Sub Init(Nr As Int, Volume As Float) As MusicEventTyp
Dim loc As MusicEventTyp
loc.Initialize
loc.SoundNr=Nr
loc.volume=Volume
Return loc
End Sub
now i want to iterate through the initalized ones, but it looks like the loop iterates through all 99:
B4X:
For Each loc As MusicEventTyp In Music
Log("SoundNr" & loc.SoundNr)
Next
does this mean, that all 99 elements are initialized from the first moment?
As a list is also not possible with user defined types... is there are chance to only iterate through the 10 defined?
Last edited: