mohammad shaterian
Member
I wrote the following code in B4J to create a loop to set the values of the buttons I created in the form, but unfortunately it does not work and returns an error. Please help.
Sub Process_Globals
Private MainForm As Form
Private Button1 As Button
Private Button2 As Button
Private Button3 As Button
Private Button4 As Button
Private Button5 As Button
Private Button6 As Button
Dim ls As List
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
ls.Initialize
ls.AddAll(Array As Button(Button1,Button2,Button3,Button4,Button5,Button6))
End Sub
Sub Button1_Click
For t=0 To 5
Dim bt As Button=ls.Get(0)
bt.Text=""
Next
End Sub
Sub Process_Globals
Private MainForm As Form
Private Button1 As Button
Private Button2 As Button
Private Button3 As Button
Private Button4 As Button
Private Button5 As Button
Private Button6 As Button
Dim ls As List
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
ls.Initialize
ls.AddAll(Array As Button(Button1,Button2,Button3,Button4,Button5,Button6))
End Sub
Sub Button1_Click
For t=0 To 5
Dim bt As Button=ls.Get(0)
bt.Text=""
Next
End Sub