repeat Array -> simple code

Discussion in 'Questions (Windows Mobile)' started by myspeed, Nov 18, 2008.

  1. myspeed

    myspeed New Member

    Hi guys~~! :)

    Plz I need a simple code.

    How can I fix?


    If stat1(1)="x" Then
    st1.Visible=false
    End If

    If stat2(1)="x" Then
    st2.Visible=false
    End If

    If stat3(1)="x" Then
    st3.Visible=false
    End If

    If stat4(1)="x" Then
    st4.Visible=false

    End if

    If stat5(1)="x" Then
    st5.Visible=false

    End if



    -----

    For K=1 to 5
    if stat(K)(1)="x" then ---->> :sign0085:
    control("st"&K).visible=false
    end if
    Next





    st1.Text=stat1(9)
    st2.Text=stat2(9)
    st3.Text=stat3(9)
    st4.Text=stat4(9)
    st5.Text=stat5(9)



    ----

    for K=1 to 5
    Control("st"&i).text=stat(K)(9) ------>> stat(K)(9) :sign0085:
    next



    Thanks for reading! :)
     
    Last edited: Nov 18, 2008
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should a double array:
    Code:
    Sub Globals
     
    Dim stat(5,SomeValue)
    End Sub
    For K=1 to 5
       
    if stat(K-1,1)="x" then
          
    control("st"&K).visible=false  
       
    end if
    Next
     
  3. myspeed

    myspeed New Member

    Thanks for the rapid reply. Erel !
     
    Last edited: Nov 19, 2008
  4. Pavel

    Pavel Member

    Думаю так будет вернее:

    Sub Globals
    Dim stat(5,SomeValue)
    End Sub
    For K=1 to ArrayLen (stat())
    if stat(K-1,1)="x" then
    control("st"&K).visible=false
    end if
    Next
     
Loading...
  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