Results 1 to 3 of 3

Thread: Quick array question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23

    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.

  2. #2
    Addicted Member
    Join Date
    Jan 2003
    Posts
    163
    where have you declared LinesArr and strTellerArray?

    dim LinesArr(100) as string
    dim strTellerArray(100) as string

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23
    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
  •  



Click Here to Expand Forum to Full Width