Hi!
I need to pass a matrix from one function/module to another.
How is this possible?? I've tried the following code by it only gives me an empty matrix on the other side, any suggestions????
The point of the code is to divide a sentence up into words and add these words into a matrix for later use.
THX in advance
Private Function fSentenceData(sSentence As String) As String
Dim mData(4) As String
Dim bSentenceEnd As Boolean
Dim iCounter As Integer
Dim iSeperatorIndex As Integer
Dim sWorkString As String
Dim sTempWord As String
Dim iStringLen As Integer
bSentenceEnd = False
sWorkString = sSentence
Do While bSentenceEnd = False
iStringLen = Len(sWorkString)
iSeperatorIndex = InStr(sWorkString, " "
If (iSeperatorIndex <> 0) Then
sTempWord = Left(sWorkString, iSeperatorIndex)
sWorkString = Right(sWorkString, (iStringLen - iSeperatorIndex))
Else
sTempWord = sWorkString
bSentenceEnd = True
End If
mData(iCounter) = sTempWord
iCounter = iCounter + 1
Loop
fSentenceData = mData(iCounter)
End Function
Private Function fScreenData(sScreenSentence As String) As Boolean
Dim mScreenData(4) As String
mScreenData(4) = fSentenceData(sScreenSentence)
End Function
When every things go black, scream, change the fuse and start over!! ARRGH!!
Atle
I need to pass a matrix from one function/module to another.
How is this possible?? I've tried the following code by it only gives me an empty matrix on the other side, any suggestions????
The point of the code is to divide a sentence up into words and add these words into a matrix for later use.
THX in advance
Private Function fSentenceData(sSentence As String) As String
Dim mData(4) As String
Dim bSentenceEnd As Boolean
Dim iCounter As Integer
Dim iSeperatorIndex As Integer
Dim sWorkString As String
Dim sTempWord As String
Dim iStringLen As Integer
bSentenceEnd = False
sWorkString = sSentence
Do While bSentenceEnd = False
iStringLen = Len(sWorkString)
iSeperatorIndex = InStr(sWorkString, " "
If (iSeperatorIndex <> 0) Then
sTempWord = Left(sWorkString, iSeperatorIndex)
sWorkString = Right(sWorkString, (iStringLen - iSeperatorIndex))
Else
sTempWord = sWorkString
bSentenceEnd = True
End If
mData(iCounter) = sTempWord
iCounter = iCounter + 1
Loop
fSentenceData = mData(iCounter)
End Function
Private Function fScreenData(sScreenSentence As String) As Boolean
Dim mScreenData(4) As String
mScreenData(4) = fSentenceData(sScreenSentence)
End Function
When every things go black, scream, change the fuse and start over!! ARRGH!!
Atle