Bug? B4A 3.0 - Code not executing the same way as in current version

DKnowles

Member
Licensed User
Longtime User
Hi All

I have this code segment

Dim MainToolBar,MTB As Panel
MainToolBar.Initialize("")
MainToolBar.LoadLayout("MenusMenu")
Activity.AddView(MainToolBar,0,100%y-51dip,100%x,51dip)
For i = 0 To MainToolBar.NumberOfViews -1
Select MainToolBar.GetView(i).tag
Case "panel" : MTB = MainToolBar.GetView(i)
End Select
Next
MainMenuButton.Initialize("")
For i = 0 To MTB.NumberOfViews -1
Select MTB.GetView(i).tag
Case "menu" : MainMenuButton = MTB.GetView(i)
Case "text" : Actionmenu = MTB.GetView(i)
End Select
Next

In current version MainToolBar.GetView(i).tag is valid and has a value 'panel' (set in the designer)

but when I execute in the rapid debugger the Case statement never matches with 'panel' and therefore MTB does not get set and the code then falls over as MTB is not initialized

Any ideas, this code is just the base code from the AHQuickAction menu example, its been working great until I just installed the beta.

Note works fine if compile in Debug (Legacy) mode.

Cheers David
 

DKnowles

Member
Licensed User
Longtime User
Hi All

Found a work around
Changed

Select MainToolBar.GetView(i).tag
Case "panel" : MTB = MainToolBar.GetView(i)
End Select

to

Dim theTag as String
theTag = MainToolBar.GetView(i).tag
Select theTag
Case "panel" : MTB = MainToolBar.GetView(i)
End Select

it appears that the Rapid debugger is not quite as forgiving if the variable type don't match.

David

problems solved though...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…