Results 1 to 6 of 6

Thread: call file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    You need to change #2 to #1 because you have not assign anything to #2 yet.

    Or

    Have you declare your variables yet?
    Chemically Formulated As:
    Dr. Nitro

  2. #2
    New Member
    Join Date
    Mar 2000
    Posts
    7
    i declared the variables already and if i change the input # to 1 i get an input past end of file error.
    meth

  3. #3
    Junior Member
    Join Date
    Apr 2000
    Posts
    22

    Question

    I'm not exactly an expert on opening text files, but have you opened anything 'For Input As #2'

    (Correct me if the above is a horrible misunderstanding / error)


    Word of advice:

    Dim fnum as integer
    fnum = FreeFile()
    Open "*****" for input as #fnum

    I don't know what it does that is special, but I read it in a book (Programming Visual Basic 6 by Francesco Balena) and it's supposed to be more reliable.
    This sentence is a lie.

  4. #4
    New Member
    Join Date
    Mar 2000
    Posts
    7
    i tried opening the file again as input#2 and vb tells me the file is already open. would it help if i posted all the code?
    thanks, meth

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Do this to get around your EOF problem
    Code:
    Do While Not EOF(1)
        Input #1, currentName, currentZip, nameSale
        Let zipSale = nameSale
        Let totalSale = nameSale
        totalSale = sale + totalSale
        If nom <> CurrntName Then
            picOutput.Print nom; zip; sale
            Let nameSale = sale
            Let currentName = nom
        Else
            ' Whatever
        End If
    Loop

  6. #6
    New Member
    Join Date
    Mar 2000
    Posts
    7

    Smile

    that was it. thanks everyone.
    meth

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