Results 1 to 4 of 4

Thread: question...noobie question for professionals..

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    15

    question...noobie question for professionals..

    I opened a file using common dialog box..

    Open " filespec.txt" for Input as #1


    BLAH BLAH BLAH

    Close #1

    I closed the farcking file....why do i get runtime error # 55

    What the farck is run time error number 55
    Does that mean that the file has not been closed properly?

    thanks!
    Samster

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    VB Code:
    1. Dim text As String
    2.  
    3. Private Sub Command1_Click()
    4. Open App.Path & "\filespec.txt" For Input As #1
    5. Do Until EOF(1)
    6. Input #1, text
    7. Text1.text = Text1.text & text
    8. Loop
    9. Close #1
    10. End Sub
    Last edited by Nightwalker83; Dec 23rd, 2002 at 11:15 PM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918
    Error 55 means 'The file is already open'.

  4. #4
    Lively Member
    Join Date
    Sep 2002
    Posts
    89
    Instead of using #1, use the FreeFile method instead
    VB Code:
    1. Dim lintFileNum as Integer
    2.  
    3. lintFileNum = FreeFile
    4. Open App.Path & "\filespec.txt" For Input As #lintFileNum
    5. Do Until EOF(1)
    6. Input #lintFileNum, text
    7. Text1.text = Text1.text & text
    8. Loop
    9. Close #lintFileNum

    - gaffa

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