I wrote this script in the designer and it works well there, but when I compile my project, B4J stops on an error. It seems there's a problem in the generated code.
ERROR:
B4J version: 4.50
Parsing code. (0.06s)
Compiling code. (0.06s)
Compiling layouts code. (0.00s)
Compiling generated Java code. Error
Error compiling designer script.
File: info, variant: General script
Line value: If chAltitude.Visible Then
javac 1.8.0_73
src\flm\b4j\runanalyst\designerscripts\LS_info.java:15: error: illegal start of expression
if (([[B4I shared]ObjectToBoolean: (String.valueOf(views.get("chaltitude").getVisible()))])) {
^
1 error
When I look at the generated Java code, the result is a bit weird:
What is this [B4I shared]ObjectToBoolean?
The only clear thing here is that this result cannot work in Java.
B4X:
'All variants script
NbPanes = 0
If chAltitude.Visible Then NbPanes = NbPanes + 1
If chHeartRate.Visible Then NbPanes = NbPanes + 1
If chVitesse.Visible Then NbPanes = NbPanes + 1
If chCadence.Visible Then NbPanes = NbPanes + 1
PanHeight = panCharts.Height / NbPanes
CurrentPos = 0
If chAltitude.Visible Then
panAltitude.Height = PanHeight
chAltitude.Height = panAltitude.Height
CurrentPos = PanHeight
End If
If chHeartRate.Visible Then
panHeartRate.Top = CurrentPos
panHeartRate.Height = PanHeight
chHeartRate.Height = panHeartRate.Height
CurrentPos = CurrentPos + PanHeight
End If
If chVitesse.Visible Then
panVitesse.Top = CurrentPos
panVitesse.Height = PanHeight
chVitesse.Height = panVitesse.Height
CurrentPos = CurrentPos + PanHeight
End If
If chCadence.Visible Then
panCadence.Top = CurrentPos
panCadence.Height = PanHeight
chCadence.Height = panCadence.Height
End If
ERROR:
B4J version: 4.50
Parsing code. (0.06s)
Compiling code. (0.06s)
Compiling layouts code. (0.00s)
Compiling generated Java code. Error
Error compiling designer script.
File: info, variant: General script
Line value: If chAltitude.Visible Then
javac 1.8.0_73
src\flm\b4j\runanalyst\designerscripts\LS_info.java:15: error: illegal start of expression
if (([[B4I shared]ObjectToBoolean: (String.valueOf(views.get("chaltitude").getVisible()))])) {
^
1 error
When I look at the generated Java code, the result is a bit weird:
B4X:
if (([[B4I shared]ObjectToBoolean: (String.valueOf(views.get("chheartrate").getVisible()))])) {
What is this [B4I shared]ObjectToBoolean?
The only clear thing here is that this result cannot work in Java.