You will get problems using Handle(). Say ArrayStation(1,5) doesn't contain a type pointer, then Handle(ArrayStation(1,5)) will cause an error.
[edit] Actually, this won't cause an error. It just returns 0. Oh, well. Take your pick :) [edit]
Instead, just explicitly cast the type pointer to an int before comparing it to zero to see if it's a valid pointer:
TBH, I was surprised this worked as I'm sure I tried something similar in the past. Seems to work fine, though. I must be thinking of something else. :)
[edit] Actually, this won't cause an error. It just returns 0. Oh, well. Take your pick :) [edit]
Instead, just explicitly cast the type pointer to an int before comparing it to zero to see if it's a valid pointer:
Type Station Field Name$ Field FileName$ Field PosX% Field PosY% Field PosZ% End Type Dim ArrayStations.Station(15, 10) For i = 1 To 15 For j = 1 To Rand(0,10) ArrayStations(i, j) = New Station arraystations(i,j)\name=Mid$("abcdefghijklmnopqrst",j,1) Next Next For i = 1 To 15 For j = 1 To 10 ptr = Int(arraystations(i,j)) If ptr Then Print ptr + " " + ArrayStations(i,j)\name Next Next WaitKey()
TBH, I was surprised this worked as I'm sure I tried something similar in the past. Seems to work fine, though. I must be thinking of something else. :)