Generic "addarraylist" problem.

Discussion in 'Questions (Windows Mobile)' started by dan kabestan, Dec 3, 2008.

  1. dan kabestan

    dan kabestan Member Licensed User

    The name-variable seems to be forbidden for it.
    As its written in help, runtime control manipulation overview,
    Control keyword - Allows us to access controls using their names as a string.
    So with Button exemple, no probem :
    man = "blue"
    AddButton ("Form1", man, 20, 20, 25, 80, "Click Me!")
    Control(man).Color = cRed '-- run right
    'So with the array list it doesnt work :
    secret = "hello"
    AddArrayList(secret) '-- < Right for compiler >
    Control(secret).add(1) '--- generates an error "unknown control type..."
    'and/or more
    Control("hello").add(1) '--- generates same error "unknown control type..."
    Its a real problem to make some generic arrays.
    Where is my mistake ? Thanks for help.
  2. agraham

    agraham Expert Licensed User

    I presume you get the error when you optimise compile. If you read the error message carefully it says
    "Unknown control type. Use Control(Name, Type) instead."


    Control(secret, [COLOR="Red"]ArrayList[/COLOR]).add(1)
  3. dan kabestan

    dan kabestan Member Licensed User

    You right. Thanks for fast answer.

  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