Android Question Warning for unused variables [not a real bug]

LucaMs

Expert
Licensed User
Longtime User
I have something like:

B4X:
Dim MyVar As ...

MyVar = MyVar2

#If DEBUG
    Log(MyVar)
#End If

This kind of code causes a "unused variable" warning.

I understand the reason but maybe it would be better not to show warnings in these cases.
 

klaus

Expert
Licensed User
Longtime User
If you want to hide given warnings in a module you can use #IgnoreWarnings: x1, x2 ...
x1 and x2 are the warning numbers.
You can add the line somewhere on top of the module code.
B4X:
#Region  Activity Attributes
   #FullScreen: False
   #IncludeTitle: True
   #IgnoreWarnings: 10, 12
#End Region
 
Upvote 0
Top