Array Question

alienhunter

Active Member
Licensed User
Longtime User
Hi to all ,

:BangHead: now for days how to :sign0161::sign0104:

is there a way to make this more flexible ?

instead having all s(0),a(0).... as fixed

something like this

coords = Array As Float(s(0),a(0),s(1),a(1)..... s(n),a(n))



B4X:
Dim s(9) As Float
Dim a(9) As Float   

   
s(0)="0.000"
s(1)="17.000"
s(2)="19.105"
s(3)="21.253"
s(4)="24.097"
s(5)="30.500"
s(6)="32.916"
s(7)="39.513"
s(8)="41.860"
'...
'S(99)="xxxxx"
    
a(0)="0.000"
a(1)="0.000"
a(2)="1.997"
a(3)="42.997"
a(4)="43.000"
a(5)="43.000"
a(6)="44.956"
a(7)="75.998"
a(8)="76.000"
'.....
'a(99)="xxxx"
   
   
coords = Array As Float(s(0),a(0),s(1),a(1),s(2),a(2),s(3),a(3),s(4),a(4),s(5),a(5),s(6),a(6),s(7),a(7),s(8),a(8)' xxxxxx....)

'
'
'
'
'
'



thanks AH
 

alienhunter

Active Member
Licensed User
Longtime User
i uploaded a example

in Activity_Create

it does like on the jpg


thanks AH

B4X:
'i just want to make points and points1 more flexible to be able to extend to n numbers if possible  not to type everything in 


points= Array As Float (s(0),a(0),s(1),a(1),s(2),a(2),s(3),a(3),s(4),a(4),s(5),a(5),s(6),a(6),s(7),a(7),s(8),a(8),s(9),a(9),s(10),a(10),s(11),a(11),s(12),a(12),s(13),a(13),s(14),a(14),s(15),a(15),s(16),a(16),s(17),a(17),s(18),a(18),s(19),a(19),s(20),a(20),s(21),a(21),s(22),a(22),s(23),a(23),s(24),a(24))
points1= Array As Float (-s(0),a(0),-s(1),a(1),-s(2),a(2),-s(3),a(3),-s(4),a(4),-s(5),a(5),-s(6),a(6),-s(7),a(7),-s(8),a(8),-s(9),a(9),-s(10),a(10),-s(11),a(11),-s(12),a(12),-s(13),a(13),-s(14),a(14),-s(15),a(15),-s(16),a(16),-s(17),a(17),-s(18),a(18),-s(19),a(19),-s(20),a(20),-s(21),a(21),-s(22),a(22),-s(23),a(23),-s(24),a(24))
 

Attachments

  • toolgraph.zip
    8.4 KB · Views: 142
  • b4a.jpg
    b4a.jpg
    19.8 KB · Views: 159
Upvote 0
Top