Hi all,
I'm struggling myself about next code. My purpose is to create 100 labels and after, remove all them.
The first part is ok, but when I try to remove all of them, it seems like if they are removed in 2 steps: view1, view3, view5 ....
The code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim canvas1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("mipanel.bal")
canvas1.Initialize(Activity)
For a=0 To 100
Dim v As Label
v.Initialize("Label")
activity.AddView(v,3,6,6,7)
v.Tag=a
Next
delete
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub delete
Dim counter As Int
counter=0
For a=0 To activity.NumberOfViews-1
Dim v As View
v=activity.GetView(a)
If v.Tag<>"" Then
v.RemoveView
Msgbox(v.Tag,"")
counter=counter+1
End If
Next
End Sub
Any ideas??
Thanks in advance!
I'm struggling myself about next code. My purpose is to create 100 labels and after, remove all them.
The first part is ok, but when I try to remove all of them, it seems like if they are removed in 2 steps: view1, view3, view5 ....
The code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim canvas1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("mipanel.bal")
canvas1.Initialize(Activity)
For a=0 To 100
Dim v As Label
v.Initialize("Label")
activity.AddView(v,3,6,6,7)
v.Tag=a
Next
delete
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub delete
Dim counter As Int
counter=0
For a=0 To activity.NumberOfViews-1
Dim v As View
v=activity.GetView(a)
If v.Tag<>"" Then
v.RemoveView
Msgbox(v.Tag,"")
counter=counter+1
End If
Next
End Sub
Any ideas??
Thanks in advance!