How to redim dynamic table

Ebic

Member
Licensed User
Longtime User
Hi, i have this problem:

1 Sub Process_Globals
2 Type RecordSale (Id As Int, Descr As String, Default As Int)
3 End Sub
4
5 Sub GloBals
6 Dim TbSale(0) As RecordSale
7 End Sub
8
9 Sub Procedure
10 Dim I as int
11
12 For i = 0 to 5
13 Dim TbSale(I) as RecordSale
14 ......... other
15 ......... code
16 next
17
18 End Sub


Wy don't work at line 13 ?
the error is : ArrayIndexOutOfBounsException

I wont to work with the table with variable elements. How can i do ?

very thanks.
 

Ebic

Member
Licensed User
Longtime User
Isn't this a Basic4android question?

I can't see any error at line 13.
B4X:
For i = 0 To 5
   Dim TbSale(I) As RecordSale
   Log(i)
 Next
Works fine, although quite why you would want to do this is a different matter. :confused:
:sign0013:
Sorry i've confused the thread.
It's a Basic4android question.

Thanks.
 
Upvote 0
Top