Posts: 2795 Reputation: 48
32 / /
Joined: Mar 2003
RE: create a .txt file through VB
BassReFlex...
You can try asking your vb questions at http://www.vbforums.com
I dont say that members here at the MsgPlus! forums here dont know vb but i think VBF is a better place to ask your VB questions.
Im there too
Posts: 2795 Reputation: 48
32 / /
Joined: Mar 2003
RE: create a .txt file through VB
You can read the data in the text before appending and then make a temp string and do: TempString = String1 & String2
If you want i can post an example
Also if you have time then register at VBF and ask your questions there
This post was edited on 05-19-2004 at 11:23 AM by Mike.
code:'This will write to the text file
Open <Path Of File> for Append As #1
Print #1, Text1.Text
Close #1
'This will read the text file
Dim strTextFile As String
Open <Path Of File> for Input as #1
Do Until EOF(1)
Input#1,strTextFile
Text1.Text=Text1.Text & strTextFile & vbnewline
Loop
Close #1
'This will clear the text file
Open <Path Of File> For Output As #1
Close #1
'OR
Kill <Path Of File>
It is easiest to use the vb Function App.Path & "\Whatever.txt"
That means that the text file you are looking for is in the same place as the exe, its a lot easier then specifing an exact path because what happens if they install the application to another place
This post was edited on 05-19-2004 at 01:46 PM by matty.