Array but not array

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Sep 22, 2007.

  1. Cableguy

    Cableguy Expert Licensed User

    Hi, guys

    I have an array of 25 items named from st1 to st25....I need this to not be an array as it is much simples to the rest of the code....so my question is how can i refer to stx wit a for next loop?

    I have tryed:

    for x = 1 to 25
    st&x="ON"
    Next x

    This doesn't work

    The reason I need it to not be an array is that I use one sub to test the value of each item but the array can be of 9, 12 or 25 items depending on user choice...
    Yes I know a normal array would be more suitable, but if I can do without...the better....
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You could use the ArrayLen method to find the array length:
    Code:
    for x = 0 to ArrayLen(myArr())-1
     myArr(x) = 
    "ON"
    next
    Also consider using an ArrayList which is more powerful than a regular array.
     
Loading...