|
-
Dec 10th, 2003, 05:02 PM
#1
Thread Starter
Junior Member
Quick array question
Another dumb newbie question.
Every time when I increment the array ni my code, it then shows as <subscript out of range>. The next time that i populate it, the array is populated with the next array number, but again, when I go past and increment the counter, it gives the error again.
here is the code that I am working with.
-----------------------
intCount = 0
Do While Not EOF(1)
Line Input #1, LinesArr(LinesRead)
If blnFound = True Then
If Trim(LinesArr(LinesRead)) <> "" Then
strTellerArray(intCount) = Trim(LinesArr(LinesRead))
intCount = intCount + 1
End If
End If
If Left(LinesArr(LinesRead), 29) = "For Employee #: All Detail" Then
strInBuf1 = LinesArr(LinesRead)
ElseIf LinesArr(LinesRead) = strTeller Then
strInBuf2 = LinesArr(LinesRead)
strTellerArray(intCount) = Trim(strInBuf2)
intCount = intCount + 1
blnFound = True
End If
ReDim Preserve strTellerArray(intCount) As String
Loop
thanks in advance.
A newbie, just trying to learn his way and get by.
-
Dec 10th, 2003, 05:17 PM
#2
Addicted Member
where have you declared LinesArr and strTellerArray?
dim LinesArr(100) as string
dim strTellerArray(100) as string
-
Dec 10th, 2003, 05:19 PM
#3
Thread Starter
Junior Member
In the beginning of the function.
Dim LinesArr() As String
ReDim LinesArr(1)
Dim strInBuf1 As String
Dim strInBuf2 As String
Dim intCount As Integer
Dim strTellerArray() As String
A newbie, just trying to learn his way and get by.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|