M myspeed New Member Nov 18, 2008 #1 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
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!
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2008 #2 You should a double array: B4X: 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
You should a double array: B4X: 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
P Pavel Member Nov 20, 2008 #4 Думаю так будет вернее: 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
Думаю так будет вернее: 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