martin2k

Google
 
Web www.martin2k.co.uk

text file


Home Read and add posts to the Visual Basic 6.0 Forums Download some of my programs and OCXs Read the Tips here The old style forum is still available here Contact

Back


From: sarah E-mail: shakingmyass@hotmail.com 1

Date: Sunday, November 25, 2001 at 22:13:49

Subject: text file

Comments:

How does a text file work?
If i saved some data how do i retrieve it.

From: Lex E-mail: webmaster@jadsoft.ch 2

Date: Saturday, October 12, 2002 at 16:06:04

Website: http://www.jadsoft.ch

Subject: RE: text file

Comments:

Hi,

You saved your text data with an Open-statement, eg.:

Open App.Path & "\test.txt" For Output As #1
Print #1, "This is a test"
Close #1

To retrieve the data read it with the Open-statement:

Dim TextLine as String
Open App.Path & "\test.txt" For Input as #1
Do While Not EOF(1)
Line Input #1, TextLine 'Text of this line will be stored in variable TextLine
  'Do something with text.

  Loop
Close
#1

Feel free to mail me for further questions.


This forum is no longer taking new messages or replies since 01 November 2002.  The above material is for reference purposes only.

The new Visual Basic 6.0 forum can be found here.


Martin Allen 1999 - 2003.  Last updated Monday 07 April 2003 07:00:50 PM +0100.