Because all my 6 panels had concrete names and all were declared as follows, I could not get the code snippet to work, even when I replaced my panels names using Panels(0), Panels(1), etc.
Sub Globals
Dim TabHost1 As TabHost
Dim pnlPanelGas,pnlPanelPressures ,pnlPanelShip As Panel
Dim pnlPanelConsumables,pnlPanelFluids,pnlPanelComments As Panel
---------------------------------------------------------------
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayoutMain")
pnlPanelGas.Initialize("")
pnlPanelPressures.Initialize("")
pnlPanelConsumables.Initialize("")
pnlPanelFluids.Initialize("")
pnlPanelShip.Initialize("")
pnlPanelComments.Initialize("")
TabHost1.AddTab2("GAS", pnlPanelGas)
TabHost1.AddTab2("PRES", pnlPanelPressures)
TabHost1.AddTab2("CONSUM", pnlPanelConsumables)
TabHost1.AddTab2("FLUID", pnlPanelFluids)
TabHost1.AddTab2("SHIP", pnlPanelShip)
TabHost1.AddTab2("COMNT", pnlPanelComments)
pnlPanelGas.LoadLayout("LayoutGas")
pnlPanelPressures.LoadLayout("LayoutPressures")
pnlPanelPressures.LoadLayout("LayoutPressures")pnlPanelConsumables.LoadLayout("LayoutConsumables")pnlPanelFluids.LoadLayout("LayoutFluids")
pnlPanelShip.LoadLayout("LayoutShip")
pnlPanelComments.LoadLayout("LayoutComments")
-------------------------------------------------------------------
Dim i, j As Int 'Dimed in globals
Dim Panels(6) 'Dimed in globals
For i = 0 To 1
For j = 0 To Panels(i).NumberOfViews - 1
Dim edt As EditText
edt = Panels(i).GetView(j)
edt.Text = ""
Next
Next
----------------------------------------------------------------------
The line that returned the same error as before is this: edt = Panels(i).GetView(j)
even with the following changes in my code to match yours:
Dim i, j As Int 'Dimed in globals
Dim Panels(6) 'Dimed in globals
For i = 0 To 5
Panels(i).Initialize("")
Next
TabHost1.AddTab2("GAS", Panels(0)) 'create a panel in 1st page
TabHost1.AddTab2("PRES", Panels(1)) 'create a panel in 2nd page
TabHost1.AddTab2("CONSUM", Panels(2)) 'create a panel in 3rd page
TabHost1.AddTab2("FLUID", Panels(3)) 'create a panel in 4th page
TabHost1.AddTab2("SHIP", Panels(4)) 'create a panel in 5th page
TabHost1.AddTab2("COMNT", Panels(5)) 'create a panel in 6th page
Panels(0).LoadLayout("LayoutGas") 'Load named layout to Panels(0) panel
Panels(1).LoadLayout("LayoutPressures") 'Load named layout to Panels(1) panel
Panels(2).LoadLayout("LayoutConsumables") 'Load named layout to Panels(2)
Panels(3).LoadLayout("LayoutFluids") 'Load named layout to Panels(3)
Panels(4).LoadLayout("LayoutShip") 'Load named layout to Panels(4)
Panels(5).LoadLayout("LayoutComments") 'Load named layout to Panels(5)