Saving Data into a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • superdudes
    New Member
    • Oct 2006
    • 5

    Saving Data into a text file

    How would i save a list of names, lets say, and then when I go to the file bar and click Class 1. How would i get the names from the txt File into a text box or label?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by superdudes
    How would i save a list of names, lets say, and then when I go to the file bar and click Class 1. How would i get the names from the txt File into a text box or label?
    Probably the simplest way is to use something like
    Code:
    Open "MyFile.txt" For Output Access Write Lock Read Write As #1
    Print #1, Count
    For I = 1 To Count
      Print #1, Name(I)
    Next
    Close #1
    Then to read them back in, you would do something like
    Code:
    Open "MyFile.txt" For Input Access Read Shared As #1
    Line Input #1,Count
    Redim Names(Count)
    For I = 1 To Count
      Line Ipnut #1, Name(I)
    Next
    Close #1
    This should help get you started, but of course I have made a lot of assumptions here.

    Comment

    Working...