Android Question Urgently need help. Problem in compilation

Richard Goh

Active Member
Licensed User
Longtime User
May I know what is gone wrong in my code? Suddenly with compiler error without much information. Check in the xfsform program can't find the line. Nothing been changed. Have tried on clean project also having the same problem. Please help.


B4A version: 5.02 (1)
Parsing code. (0.34s)
Compiling code. (0.73s)
Compiling layouts code. (0.01s)
Generating R file. (0.08s)
Compiling debugger engine code. (4.29s)
Compiling generated Java code. Error
B4A line: 466
GridV_.HeaderColor = Colors.Gray
javac 1.7.0_75
src\b4a\xfs\xfsform.java:1352: error: cannot find symbol
_gridv_.setxlstable._headercolor(null,anywheresoftware.b4a.keywords.Common.Colors.Gray);
^
symbol: variable setxlstable
location: variable _gridv_ of type gridview

B4X:
Sub GridView_Init(pGridV As GridView, gridPnl As Panel) As GridView
    pGridV.CellAlignment = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)   
    pGridV.HeaderColor = Colors.Gray
    pGridV.HeaderTextColor = Colors.Black
End Sub

GridView Class
Public Sub setHeaderColor(Color As Int)
    cHeaderColor = Color
End Sub

Public Sub getHeaderColor As Int
    Return cHeaderColor
End Sub
 

Richard Goh

Active Member
Licensed User
Longtime User
Found the cause of the problem. I have 2 classes having the same variable declare inside both classes. B4a can't have a same variable name declared in class globals inside different classes in the same apps. Why there can't have a Globals methods in Class? So that we can declare the same variable name to use only for the class and it will not got confused in different classes. Will it be improve
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top