In a B4XPages project I have a page with the following code:
Sub Class_Globals
Private btnSourceOfDataTypes As B4XView
Private chkFilterSQL As CheckBox
End Sub
Sub btnSourceOfDataTypes_Click()
Enums.bDataTypesFromSysColumns = Enums.bDataTypesFromSysColumns = False
If Enums.bDataTypesFromSysColumns Then
btnSourceOfDataTypes.Text = "From SysColumns"
Else
btnSourceOfDataTypes.Text = "From Cursor"
End If
cMP.SaveSetting("Enums.bDataTypesFromSysColumns", Enums.bDataTypesFromSysColumns)
End Sub
Sub chkFilterSQL_Click()
Enums.bFilterOnLoadSQL = chkFilterSQL.Checked
cMP.SaveSetting("Enums.bFilterOnLoadSQL", Enums.bFilterOnLoadSQL)
End Sub
chkFilterSQL and btnSourceOfDataTypes are in the layout file and the event names are the same as the view names.
I get the mentioned warning in the log and also as in the IDE (wavy line under the code and warning popping when moving cursor over it).
This happes for chkFilterSQL, but not for btnSourceOfDataTypes.
All compiles fine and runs fine.
I can't comment out:
Private chkFilterSQL As CheckBox
As then I get a red warning in the log:
P_Settings1 - 313: Undeclared variable 'chkfiltersql' is used before it was assigned any value.
And I can't compile.
Again, all compiles and runs fine as it is, but just would like to understand and ideally fix the mentioned warning.
RBS