Arrays of "Objects"

PaulR

Active Member
Licensed User
Longtime User
So let's say we have...
B4X:
Dim p As Point
... if I want to create an array of these, how would I go about it?

At the moment I am creating uniquely names variables to do this, but I'd like to run through them with a For... Next.

Any ideas?
 

Jost aus Soest

Active Member
Licensed User
Longtime User
So let's say we have...
B4X:
Dim p As Point
... if I want to create an array of these, how would I go about it?

At the moment I am creating uniquely names variables to do this, but I'd like to run through them with a For... Next.

B4X:
Dim points(100) As Point

'Fill points-array, e. g.:
points(0) = p1
points(1) = p2
'...

'Run through all Points:
For i = 0 To points.Length - 1
  DoSomething(points(i))
Next'i
 
Last edited:
Upvote 0
Top