Mikey B
05-29-2003, 11:50 AM
Hi i have a list of family members in a text file like this
Me
Mum
Dad
Sis
Bro
And i want to read one at a time and delete it once its finished reading it. So it will read 'Me' first then add it to a text box in VB and then deletes 'Me' from the original text file and goes onto the next one. However the next family member must then be at the begininning of the text file. So once it deletes 'Me' The text file is closed. Its then opened again and 'Mom' is at the top of the list.
This is the code ive got so far
dim counter as integer
Open "c:\famile.txt" For Input As #1
counter = 1
Do While Not EOF(1)
Input #1, name
Text2.Text = name
'code goes here to delete the line from the text file
close #1
loop
I admit that it wasnt explained very well so if you need any more info then just ask.
Mikey
Me
Mum
Dad
Sis
Bro
And i want to read one at a time and delete it once its finished reading it. So it will read 'Me' first then add it to a text box in VB and then deletes 'Me' from the original text file and goes onto the next one. However the next family member must then be at the begininning of the text file. So once it deletes 'Me' The text file is closed. Its then opened again and 'Mom' is at the top of the list.
This is the code ive got so far
dim counter as integer
Open "c:\famile.txt" For Input As #1
counter = 1
Do While Not EOF(1)
Input #1, name
Text2.Text = name
'code goes here to delete the line from the text file
close #1
loop
I admit that it wasnt explained very well so if you need any more info then just ask.
Mikey