Hi,
is there a way to insert a string into a specific part of a text file from visual basic 6?
this is the relevant code:
- Open CommonDialog1.FileName For Input As #1
-
Do While Not EOF(1)
-
Input #1, data
-
If InStr(data, Date) Then
-
: stringinsertion
-
Close #1
-
Else
-
End If
-
Loop
-
Close #1
so if an entry from the same date had already been recorded in the text file, would i be able to add a new string next to the date in this file using the "stringinsertion" sub? If so, what code would be required?
Many thanks.
Hello!
You should Open
CommonDialog1.FileName For Append As #1 to start yourself off. Input reads the file, you can also use Output As...if you read up about it, you'll see a difference but do record to file nonetheless. For additional help about a point in time to Append, please stay tuned.
You could need either a timer, or counter to be a ble to tell at which point you need to Append. If you look further into this forum you may find something already posted.
Good luck and welcome!