I am converting some C code to B4A and one of the statements was :
This literally translated into B4A as :
However, when I came to compile the code, it failed with :
B4A line: 45
aa = aa - -1
javac 1.6.0_45
src\b4a\example\main.java:851: ')' expected
_aa = (int) (_aa--1);
^
It looks like B4A is stripping out the space between the '-' sign and the '-1' literal causing the compile failure.
I know I should use
instead but I thought I would mention the bug.
Jon.
B4X:
obj->rotz -= (rotz < 0) ? -1 : 1;
This literally translated into B4A as :
B4X:
If rotz < 0 Then
obj.rotz = obj.rotz - -1
Else
obj.rotz = obj.rotz - 1
End If
However, when I came to compile the code, it failed with :
B4A line: 45
aa = aa - -1
javac 1.6.0_45
src\b4a\example\main.java:851: ')' expected
_aa = (int) (_aa--1);
^
It looks like B4A is stripping out the space between the '-' sign and the '-1' literal causing the compile failure.
I know I should use
B4X:
obj.rotz = obj.rotz + 1
instead but I thought I would mention the bug.
Jon.