467,115 Members | 1,295 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,115 developers. It's quick & easy.

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?
Oct 30 '06 #1
  • viewed: 4610
Share:
1 Reply
Expert 8TB
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
Expand|Select|Wrap|Line Numbers
  1. Open "MyFile.txt" For Output Access Write Lock Read Write As #1
  2. Print #1, Count
  3. For I = 1 To Count
  4.   Print #1, Name(I)
  5. Next
  6. Close #1
Then to read them back in, you would do something like
Expand|Select|Wrap|Line Numbers
  1. Open "MyFile.txt" For Input Access Read Shared As #1
  2. Line Input #1,Count
  3. Redim Names(Count)
  4. For I = 1 To Count
  5.   Line Ipnut #1, Name(I)
  6. Next
  7. Close #1
This should help get you started, but of course I have made a lot of assumptions here.
Oct 30 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by G-Factor | last post: by
5 posts views Thread by Jason | last post: by
5 posts views Thread by Lee | last post: by
5 posts views Thread by TheGanjaMan | last post: by
8 posts views Thread by Yu SONG | last post: by
reply views Thread by Shyam Barnwal | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.