You are long enough here to understand me. If not; learn the basics
Instead of using three parameters (or 100) you use a map and put all parameters inside this map.
The called sub takes this map and reads all needed informations from this map.
And retrieve them by name.I suggest using a map. Here you can store int, long, string, lists, objects
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private Label1 As Label
Dim Map1 As Map
End Sub
Sub Activity_Create(FirstTime As Boolean)
Label1.Initialize("")
Label1.Color=Colors.White
Label1.TextColor=Colors.Black
Label1.Text="THIS IS TEST TEXT"
Activity.AddView(Label1,0,0,100%X,25%Y)
Setup(Label1,True,0.6,False)
CallSubDelayed(Me,"Test")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Public Sub Setup(A As View,B As Boolean,C As Float,D As Boolean)
Map1.Initialize
Map1.Put("A",A)
Map1.Put("B",B)
Map1.Put("C",C)
Map1.Put("D",D)
End Sub
Public Sub Test
Dim source As Reflector
source.Target=Map1.GetValueAt(0)
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
Log(Map1.GetValueAt(1))
Log(Map1.GetValueAt(2))
Log(Map1.GetValueAt(3))
End Sub
CallSubDelayed2(Me,"Test",Label1)
Public Sub Test(ViewName As View)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
Log(Map1.GetValueAt(1))
Log(Map1.GetValueAt(2))
Log(Map1.GetValueAt(3))
End Sub
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Label1.Initialize("Label1")
Label1.Color=Colors.White
Label1.TextColor=Colors.Black
Label1.Text="THIS IS TEST TEXT"
Activity.AddView(Label1,0,0,100%X,25%Y)
CallSubDelayed2(Me,"Test",Label1)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Public Sub Test(ViewName As View)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
understood....this is my issueYou are passing a Label to the Subroutine, the Subs Signature should be:
Public Sub Test(ThisLabel As Label)
Public Sub Test(ViewName As View)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
Sub Activity_Create(FirstTime As Boolean)
CallSubDelayed2(Me,"Test",Label1)
End Sub
Public Sub Test(ViewName As Label)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
Public Sub Test(ViewName As Label)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
Public Sub Test(ViewName As Button)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
Sub Activity_Create(FirstTime As Boolean)
CallSubDelayed(Me,"RunTest")
End Sub
Sub RunTest
Test(Label1)
End Sub
Public Sub Test(ViewName As View)
Dim source As Reflector
source.Target=ViewName
Dim LineCount As Int=source.RunMethod("getLineCount")
Log(LineCount)
End Sub
Activity.AddView(Label1,0,0,100%X,25%Y)
Dim Target As Object = Label1
CallSubDelayed2(Me,"Test",Target)
Public Sub Test(Target As Object)
Dim T As View = Target
Dim Source As Reflector
Source.Target = T
Dim LineCount As Int=Source.RunMethod("getLineCount")
Log(LineCount)
End Sub