read a string from ".txt"

i need to read a string from a txt file.
and i need to update that file with a new string
how i can?
methhhAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

methhhAuthor Commented:
thanks =) !!
0
dmstratCommented:
Can you explain more of what you are trying to accomplish.  It can really help with your answer.

If you are trying to simply keep information for your program you should really use the "SaveSetting" feature to save to the Registry.  This would allow for you to save that information over and over and make changes without having to use the FileSystemObject.

Here is a link on how to do that.

http://www.developerfusion.com/show/44/2/

If you HAVE to work with this file instead of the registry save, you can use the FileSystemObject with the TextStream Object (both searchable on microsoft.com).  

You would make a simple FileSystemObject and then open the file.  This opening becomes a TextStream object and you have a method called "readline" that should give you the information you need.  You also have a "writeline" method that can put the new information in that you need to save.

Hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
YaakovSCommented:
I’m not sure what exactly you are trying to do, you can read a txt file using the Input command (I don’t know why but I’m assuming it’s a comma delimited) example:

Open app.path & “\whateveryourfileiscalled” for input as #1
Do while not eof(1)
     Input #1 strone, strtwo…

Loop
Then to write just open the file for output or if you want to add to it open it for append.
0
methhhAuthor Commented:
thanks dmstrat!!! =)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.