Hi I have a text file with an extract of information:
"Saturday, March 15, 2003" 47 28 4 25 38 24 11
"Wednesday, March 12, 2003" 33 16 6 37 40 41 25
"Saturday, March 08, 2003" 32 5 8 6 33 41 15
"Wednesday, March 05, 2003" 23 8 3 34 46 12 24
"Saturday, March 01, 2003" 29 31 45 44 22 24 35
I have the following code so far:
Module Code:
Option Explicit
Type drawInfo
date As String * 31
ball1 As Integer
ball2 As Integer
ball3 As Integer
ball4 As Integer
ball5 As Integer
ball6 As Integer
bonusBall As Integer
End Type
Public lotResults As drawInfo
Form code:
Dim fieldLength As Long
Dim position As Integer
Private Sub cmdReadRecord_Click()
Get #1, position, lotResults
txtBall1.Text = lotResults.ball1
txtBall2.Text = lotResults.ball2
txtBall3.Text = lotResults.ball3
txtBall4.Text = lotResults.ball4
txtBall5.Text = lotResults.ball5
txtBall6.Text = lotResults.ball6
txtBBall.Text = lotResults.bonusBall
txtDate.Text = lotResults.date
position = position + 1
End Sub
Private Sub Form_Load()
fieldLength = LenB(lotResults)
position = 1
Open "results.txt" For Random As #1 Len = fieldLength
End Sub
It just outputs the data as 0, do i need to convert the file into a format readable by vb or is it because of my code
"Saturday, March 15, 2003" 47 28 4 25 38 24 11
"Wednesday, March 12, 2003" 33 16 6 37 40 41 25
"Saturday, March 08, 2003" 32 5 8 6 33 41 15
"Wednesday, March 05, 2003" 23 8 3 34 46 12 24
"Saturday, March 01, 2003" 29 31 45 44 22 24 35
I have the following code so far:
Module Code:
Option Explicit
Type drawInfo
date As String * 31
ball1 As Integer
ball2 As Integer
ball3 As Integer
ball4 As Integer
ball5 As Integer
ball6 As Integer
bonusBall As Integer
End Type
Public lotResults As drawInfo
Form code:
Dim fieldLength As Long
Dim position As Integer
Private Sub cmdReadRecord_Click()
Get #1, position, lotResults
txtBall1.Text = lotResults.ball1
txtBall2.Text = lotResults.ball2
txtBall3.Text = lotResults.ball3
txtBall4.Text = lotResults.ball4
txtBall5.Text = lotResults.ball5
txtBall6.Text = lotResults.ball6
txtBBall.Text = lotResults.bonusBall
txtDate.Text = lotResults.date
position = position + 1
End Sub
Private Sub Form_Load()
fieldLength = LenB(lotResults)
position = 1
Open "results.txt" For Random As #1 Len = fieldLength
End Sub
It just outputs the data as 0, do i need to convert the file into a format readable by vb or is it because of my code