This fragment works in the IDE but fails when optimised compiled
B4X:
VScrollVisible = obj2.GetProperty("Visible") 'Vertical scroll bar visible
If VScrollVisible = True Then
' not reached when optimised compiled
...
This compiles to
B4X:
if (LCompareEqual(var__main_vscrollvisible,@"true"))
The reason for failure is that that the Door library returns "False" or "True" for Booleans and in this case LCompareEqual does a case-sensitive comparison against "true" which therefore fails.
B4X:
return (lSide == rSide);
Has something changed in 6.80? If not I'm astonished that I haven't noticed this before!
Sub Globals
Dim b(2) As Boolean
End Sub
Sub App_Start
b(0) = False
b(1) = True
If b(0) = False Then
Msgbox(b(0), 1) 'IDE and optimise both fail
End If
If B(1) = True Then
Msgbox(b(1), 1) 'IDE and optimise both fail
End If
If Not(B(0)) Then
Msgbox(b(0), 2) 'IDE and optimise both work
End If
If B(1) Then
Msgbox(b(1), 2) 'IDE and optimise both work
End If
End Sub
I see this bug too and its lies in the door library. It will be fixed soon.
It only happens with booleans returned from the door library (as object rather than boolean) so I think that it was always there.
Support for boolean arrays was not added yet. It is still on the list.
I thought I remembered checking that, obviously not.
My aging memory is obviously not what it used to be.
A bit like the rest of me!
I 'll need to start festooning the monitor with Post-it notes before long!