I am trying to add a variable number of label date headings to a panel created in the program and keep getting an error message "Only 'Length' is supported by arrays." I have done similar things before without any issues so not sure what I am doing wrong this time. The error occurs on the first initialize within the for/next loop.
Thanks.
B4X:
Dim q As Panel
q.Initialize("pnlSummaryTotalsBack")
q.Color = Colors.Black
Activity.AddView(q, 2dip, 50dip, 1020dip, 380dip)
Dim p As Panel
p.Initialize("pnlSummaryTotals")
p.Color = Colors.ARGB(255, 52, 100, 0)
q.AddView(p, 2dip, 2dip, 1016dip, 376dip)
' Add summary basic details
For x = 0 To intTotalDates
lblDateFrom.Initialize("lblDateFrom")
lblDateFrom.TextColor = Colors.Black
lblDateFrom.Text = tabDates(x,0)
lblDateFrom.TextSize = 14
lblDateFrom.Typeface = Typeface.MONOSPACE
lblDateFrom.Gravity = Gravity.CENTER
p.AddView(lblDateFrom, 360dip + ((7 - intTotalDates) + (x * 45dip)), 10dip + ((14 - intTotalStores) + (x * 10dip)), 80dip, 20dip)
lblDateFrom(x) = p
lblTo.Initialize("lblTo")
lblTo.TextColor = Colors.Black
lblTo.Text = "To"
lblTo.TextSize = 14
lblTo.Typeface = Typeface.MONOSPACE
lblTo.Gravity = Gravity.CENTER
p.AddView(lblTo, 360dip + ((7 - intTotalDates) + (x * 45dip)), 24dip + ((14 - intTotalStores) + (x * 10dip)), 80dip, 20dip)
lblTo(x) = p
lblDateTo.Initialize("lblDateTo")
lblDateTo.TextColor = Colors.Black
lblDateTo.Text = tabDates(x,1)
lblDateTo.TextSize = 14
lblDateTo.Typeface = Typeface.MONOSPACE
lblDateTo.Gravity = Gravity.CENTER
p.AddView(lblDateTo, 360dip + ((7 - intTotalDates) + (x * 45dip)), 40dip + ((14 - intTotalStores) + (x * 10dip)), 80dip, 20dip)
lblDateTo(x) = p
Next
Thanks.