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 = 0To sl.Length - 1Log(sl(i))
NextEndSub
Option 2
B4X:
Sub Process_GlobalsPrivate MyList As List
..
Sub AppStart(Form1 As Form, Args() As String)
...
MyList.Initialize
MyList.AddAll(ArrayAs String("A", "B", "C"))
MySub(MyList)
...
Sub MySub(l As List)
For i = 0To l.Size - 1Log(l.Get(i))
NextEndSub
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.