J JaunLukePicard Member Licensed User Longtime User Jun 22, 2014 #1 With a String array defined as the following: Dim str() as String = Array of String("1", "2", "3") in the main class. How would I pass this String array to a Class Module? My Example: Public sub subFunction(str() as String) .... .... End Sub Do I have to indicate the same number of elements for the string in the Class I want to pass the String array to? I don't think so. Or should I use a List? Do I need to define a String array to pass the array from the calling module/class?
With a String array defined as the following: Dim str() as String = Array of String("1", "2", "3") in the main class. How would I pass this String array to a Class Module? My Example: Public sub subFunction(str() as String) .... .... End Sub Do I have to indicate the same number of elements for the string in the Class I want to pass the String array to? I don't think so. Or should I use a List? Do I need to define a String array to pass the array from the calling module/class?
Erel B4X founder Staff member Licensed User Longtime User Jun 22, 2014 #2 There is nothing special about array objects. Code: Copy Dim c1 As MyClass c1.Initialize Dim str() As String = Array As String("1", "2", "3") c1.Sub1(str) c1 code: Code: Copy Sub Sub1(Numbers() As String) Upvote 0
There is nothing special about array objects. Code: Copy Dim c1 As MyClass c1.Initialize Dim str() As String = Array As String("1", "2", "3") c1.Sub1(str) c1 code: Code: Copy Sub Sub1(Numbers() As String)
J JaunLukePicard Member Licensed User Longtime User Jun 23, 2014 #3 Got it Erel. The reason I got the coding wrong was that I was adding an extra set of parens while passing the array of strings. Thank you Upvote 0
Got it Erel. The reason I got the coding wrong was that I was adding an extra set of parens while passing the array of strings. Thank you