Android Question warning #20 Table class

Discussion in 'Android Questions' started by RB Smissaert, Apr 13, 2018.

  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    I am using the Table class in the designer, added to a panel (Add View, CustomView, Table)
    I declare the class in Sub Globals():
    Private TableX As Table
    This causes a warning in the IDE:
    View 'TableX' was added with the designer. You should not initialize it. (warning #20)
    This is not actually causing any problems.
    If I leave the declaration out I will get:
    Undeclared variable 'tablex' is used before it was assigned any value.
    How should this be done?

  2. udg

    udg Expert Licensed User

    When you add a component in the Designer, you should use Tools/Generate Members to have a reference of it placed in your code.
    Then simply use that reference (no Init) as if you declared it yourself.
  3. klaus

    klaus Expert Licensed User

    Without seeing your code it's impossible to geive a concrete advice.
    You say that you added the Table in the Designer, so you must not initialize it in the code.
    In the demo program Table1 is added in the Designer and Table2 is added in the code.

    What Name did you give the Table in the Designer?
    Otherwise post your project so we can see what exactly you have done.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice