Android Question When creating a new b4xPage Class

PdeG

Member
Licensed User
Longtime User
in the Class_Globals this is created by default,

B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
End Sub

what is the meaning of 'ignore and what does it do?

Regards,
Peter
 
Solution
Try remove the 'ignore
B4X:
Private Root As B4XView

You will get:
B4X:
Unused variable 'Root'. (warning #9)

Now, try to add 'ignore after the line:
B4X:
Private Root As B4XView 'ignore
The warning is gone.

The 'ignore keyword is use to suppress the warning. In most cases, you don't use it. It means the variable has not yet been used.

aeric

Expert
Licensed User
Longtime User
Try remove the 'ignore
B4X:
Private Root As B4XView

You will get:
B4X:
Unused variable 'Root'. (warning #9)

Now, try to add 'ignore after the line:
B4X:
Private Root As B4XView 'ignore
The warning is gone.

The 'ignore keyword is use to suppress the warning. In most cases, you don't use it. It means the variable has not yet been used.
 
Last edited:
Upvote 1
Solution

ilan

Expert
Licensed User
Longtime User
in the Class_Globals this is created by default,

B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
End Sub

what is the meaning of 'ignore and what does it do?

Regards,
Peter
if you add a new variable or view to the Class_Globals but it is not used anywhere the IDE will throw a warning. Adding ignore will ignore the warning for the specific variable view
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Now, try to add 'ignore after the line:
B4X:
Private Root As B4XView 'ignore
The warning is gone.
Wow Aeric, after several years of ignoring some of those warnings (which Erel told me once to ignore in general) I have a way now to eliminate those pesky warnings in my logs window. Yippee! Thanks Aeric, you library of code knowledge you. Now I hope Ivica loves me; maybe, maybe not.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
if you DON´T want the warning at all, yes.

But usually the warning is a good thing. You can not find the problem if you don´t get it.

Getting the warning you now are able to decide whether this is OK for the mentioned variable or not.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
You may want to ignore warnings (even of other types) only for some "objects" (unused variables, in this specific case), perhaps temporarily, and not for others and therefore use 'ignore instead of #IgnoreWarnings: 9.
Thanks Don, Luca and Aeric; and Peter for the thread.
 
Upvote 0
Top