I'm retired and thought I'd like to learn vs 2008 Express as a hobby. I'm running Vista Home Premiun.
This is my first post and hope not to bug you people too much.
Thanks for all your help I'm about to recieve
wes
Private Sub openChequeBook()
Dim mo As String
Dim a As Single
Dim p As String
Dim cbb As Single
Dim d As Decimal
Dim fn As String = "C:\\ChequeBook\purchases.txt"
If System.IO.File.Exists(fn) = True Then
Dim objReader As New System.IO.StreamReader(fn)
Dim sp As String, text As String, bigtex As String
sp = " " ''20 spaces
text = ""
bigtex = ""
Do While objReader.Peek() <> -1
mo = objReader.ReadLine
a = objReader.ReadLine
cbb = objReader.ReadLine
p = objReader.ReadLine
text = mo & sp
text = text.Substring(0, 13)
bigtex = bigtex & text
text = String.Format("{0:c}", a) & sp
text = text.Substring(0, 9)
bigtex = bigtex & text
text = String.Format("{0:c}", cbb) & sp
text = text.Substring(0, 11)
bigtex = bigtex & text
text = p & sp
text = text.Substring(0, 19)
bigtex = bigtex & text & vbNewLine
Loop
objReader.Close()
TextBox1.Text = bigtex
Else
MsgBox("File Does Not Exist")
End If
End Sub
EDIT: Please, next time, use code tags, like so (
Thanks
This post has been edited by PsychoCoder: 24 January 2008 - 01:50 PM

New Topic/Question
Reply




MultiQuote





|