Android Question '=' expected. Error File: main.bal

jimmyF

Active Member
Licensed User
Longtime User
Hi,
First post. :)
I am very new to B4A but have a background in VB from VB 1.0 for DOS to VB.net.

I was playing around with some source code from this site in order to learn how it all works.
Specifically, I had a working app and decided to delete a Label that had been included in main.bal in the Visual Designer. I have also deleted all references to it in code.
The app no longer runs and this is the error when I attempt to compile:

<ERROR>
B4A version: 6.80
Parsing code. (0.00s)
Compiling code. (0.06s)
Compiling layouts code. Error
'=' expected.
Error File: main.bal

Go to the designer script page to debug this error.
</ERROR>

The designer script page has been edited and the Label code has been removed. In fact, when I remove all of the script from the designer I still get this error.

Any help or pointers in the right direction would be appreciated.

Thanks
JimmyF
 

klaus

Expert
Licensed User
Longtime User
The designer script page has been edited and the Label code has been removed. In fact, when I remove all of the script from the designer I still get this error.
Are you sure?
Perhaps you have another layout variant where the Label is still referenced.
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Very sure, thank you.
There is definitely no other reference in any layout variant.
And no reference in code.
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Here is the project.

Thanks
JimmyF
 

Attachments

  • TestNotePad.zip
    43.4 KB · Views: 292
Upvote 0

klaus

Expert
Licensed User
Longtime User
As suspected, look at the main layout file in the 480 x 320 layout variant you still hace references to lblFileName.Top !
B4X:
'Variant specific script: 480x320,scale=1
pnlToolBox.Right = 100%x
pnlToolBox.SetTopAndBottom(0, 100%y)

If ActivitySize < 6 Then
    btnNew.Top = 0
    btnLoad.Top = btnNew.Bottom
    btnSave.Top = btnLoad.Bottom
    btnSetup.Bottom = 100%y
Else
    btnSave.VerticalCenter = 50%y
    btnLoad.Bottom = btnSave.Top
    btnNew.Bottom = btnLoad.Top
    btnSetup.Top = btnSave.Bottom + btnSave.Width
End If

lblFileName.Top = 0
lblFileName.SetLeftAndRight(0, pnlToolBox.Left - 1dip)

edtPad.SetLeftAndRight(0, pnlToolBox.Left)
edtPad.SetTopAndBottom(lblFileName.Bottom, 100%y + 4dip)
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
This is really, really, really weird because this is a direct copy and paste from my project:
I had replaced a Label with a Spinner - sprFiles


B4X:
'Variant specific script: 320x480,scale=1
pnlToolBox.Bottom = 100%y
pnlToolBox.SetLeftAndRight(0, 100%x)

btnSave.HorizontalCenter = 50%x
btnLoad.Right = btnSave.Left
btnNew.Right = btnLoad.Left
btnSetup.Left = btnSave.Right + btnSave.Width

sprFiles.Top = 0
sprFiles.Width = 100%x

edtPad.SetTopAndBottom(sprFiles.Bottom, pnlToolBox.Top + 4dip)
edtPad.SetLeftAndRight(0, 100%x)


I had even deleted all of that script and I still got the error.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The problem is that you modified the 320 x 480 layout variant but not the 480 x 320 layout variant.
The copy in post#6 is also a copy from your project!
You must select the layout variant to see it's code!

upload_2017-3-26_18-5-7.png
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
:oops: I Had no idea that layout variant even existed.
Thank you for this. Still lots to learn.
And thank you for your patience.

JimmyF
 
  • Like
Reactions: eps
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
;)
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Thank you Erel.

I have read the Designer Scripts Tutorial but I do not seem to have the Designer Scripts tab shown in the tutorial. Just the Script-Variant and the Script-General tabs which I was using.
I do not see a difference nor do I understand the difference between a designer script and a variant script. The tutorial talks about and suggests using variants so how do I avoid their use?
I am a bit confused here. I do understand the value of using 'dip' units as opposed to trying to write for every possible scenario.
Sorry if I am a bit dense but I am just learning the IDE and the B4X syntax.
I am using version 6.80 of B4A
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Thank you.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
If you look at the image in post#8 you see at the right side three tabs: Script-Variant, Script-General, Abstract Designer.
On the top left side you see the Variants window.
Selecting a variant in that window shows you the code for that variant in the Script-Variant tab.
The layout of the different windows may look different in your IDE.
 
Upvote 0

jimmyF

Active Member
Licensed User
Longtime User
Yes, I see all that now.
Thank you, Klaus, for your assistance.

Takes me a while. :confused:
But I DO get it in the end. :)
 
Upvote 0
Top