Can someone please post a snippet of a user defined Sub with a parameter as a List or an Array of string values. I want to pass something like this: MySub("A,B,C")
Sub AppStart (Form1 As Form, Args() As String)
...
MySub("A,B,C")
Sub MySub(s As String)
Dim sl() As String = Regex.Split(",", s)
For i = 0 To sl.Length - 1
Log(sl(i))
Next
End Sub
Option 2
B4X:
Sub Process_Globals
Private MyList As List
..
Sub AppStart (Form1 As Form, Args() As String)
...
MyList.Initialize
MyList.AddAll(Array As String("A", "B", "C"))
MySub(MyList)
...
Sub MySub(l As List)
For i = 0 To l.Size - 1
Log(l.Get(i))
Next
End Sub
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.