I have managed to make a small program that writes data to a .txt file on close (to save settings that the user alters on program usage) but i need a way to read the settings (which are on one like at a time) and store them into integer variables. (I have seen ways of loading all the text in the file into a variable, but not one line at a time) All the data in the .txt file are numbers. Any ideas?
In addition, when the data is stored in the .txt file, a space is at the start of each line. Anyidea's of how to stop this from happening?
Here is the code that writes the data to the .txt file, I dont currently have code to read the file:
Private Sub AppendTextToFil e()
Dim intfile As String
intfile = FreeFile
Open "Settings.t xt" For Append As intfile
Print #intfile, FrmMain.Top
Print #intfile, FrmMain.Left
Print #intfile, HScroll1.Value
Close intfile
End Sub
This is just a test program before I start a bigger project. I will be having up to 10 lines of data in the .txt file, give or take, and that number will never change one the program is completed.
Hope you can help
In addition, when the data is stored in the .txt file, a space is at the start of each line. Anyidea's of how to stop this from happening?
Here is the code that writes the data to the .txt file, I dont currently have code to read the file:
Private Sub AppendTextToFil e()
Dim intfile As String
intfile = FreeFile
Open "Settings.t xt" For Append As intfile
Print #intfile, FrmMain.Top
Print #intfile, FrmMain.Left
Print #intfile, HScroll1.Value
Close intfile
End Sub
This is just a test program before I start a bigger project. I will be having up to 10 lines of data in the .txt file, give or take, and that number will never change one the program is completed.
Hope you can help
Comment