I am getting an error when trying to pass a Split directly to another function.
This is the Add function - It is in a class module:
From another module, I want to do this:Code:Public Sub Add(strItem As String) If Arr(0) <> "" Then 'Redimension Array ReDim Preserve Arr(UBound(Arr) + 1) End If 'Add channel to end of array Arr(UBound(Arr)) = strItem End Sub
However, this gives me a ByRef error. I can fix this by doing this:Code:TheBot.Prop_Controllers.Add Split(Parameter," ")(1)
But seeing as I use that statement many times in the same module, I would rather not double my sourcecode size. Is there any way to get around this error without using a lot of extra code? Maybe a C-Style static cast?Code:Dim mysplit As String mysplit = Split(Parameter, " ")(1) TheBot.Prop_Controllers.Add mysplit
Any help would be appreciated!
DocUK




Reply With Quote