Hey I was wondering how do I go about doing this.
I want it such that if the position parameter passed to the readCommand function is 1, the first part of the string "aaa" will be returned, and so on.
the code above gave a type mismatch, I am guessing its because the Split method is only for arrays? Any suggestions?
Thanks!
Code:
strCommand = readCommand("aaa;sss;ddd", 1)
MsgBox (strCommand)
Code:
Public Function readCommand(str As String, position As Integer) As String If position = 1 Then str = Split(str, ";") readCommand = str End If End Function
the code above gave a type mismatch, I am guessing its because the Split method is only for arrays? Any suggestions?
Thanks!
Comment