compilation error in 2.70 beta 1

Dave O

Well-Known Member
Licensed User
Longtime User
Just downloaded 2.7 beta 1, and tried compiling an app that compiled fine with 2.5x.

Got error "Object reference not set to an instance of an object." on the line that assigns to label.text below. But for the life of me, I can't figure out what's wrong.

Here's the code, which creates items to add to Informatix's clsChecklist:

B4X:
Sub createLvItem(indexArg As Int) As Panel
   Dim tempProto As proto      
   tempProto.Initialize
   tempProto = protoList.get(indexArg)  'protoList is a global list
   
   Dim tempPanel As Panel
   tempPanel.Initialize("")
   tempPanel.Color = Colors.RGB(238, 238, 238)

   Dim pagesLabel As Label
   pagesLabel.Initialize("")
   pagesLabel.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.left)
   pagesLabel.TextSize = 18
   pagesLabel.TextColor = Colors.DarkGray
   'pageTotal is an Int
   pagesLabel.Text = tempProto.pageTotal & " pages"   '<<< error
   tempPanel.AddView(pagesLabel, 75%x, 0dip, 100dip, itemHeight / 2)
   
   Return tempPanel
End Sub

I can export the source if that helps. Any help much appreciated!
 
Last edited:

Dave O

Well-Known Member
Licensed User
Longtime User
Yep, here you go. I downgraded to 2.52 in the meantime, and it compiles in 2.52, but should open in 2.7 too.
 

Attachments

  • QuickProto20130510.zip
    124.3 KB · Views: 210

Dave O

Well-Known Member
Licensed User
Longtime User
Ah ha, you're right. Thanks for that. I changed the module name and everything is golden again.

I assume that 2.7 is stricter than earlier versions about this kind of thing, which is good because it's bad form to have two different things with the same name.

Cheers!
 
Top