I have been stuck with a program that needs to read in (line by line, so as to match strings) a binary file created using the Put Statement. The person who began the program did not write to the log files using record numbers. They simply did the following:
***CODE***
***END CODE***
There work out to be a total of about 24 fail modes put in after the total counts. My problem is that I need to populate a form/variables with the count for each failure mode. That is, I need to read in a line, see what fail mode it is, match it to a variable, and populate the count variable for that fail mode with the count read in the file. If it was me, I would have created a type, and put each fail mode in as a record, as the Get Statement has a variable for recnumber. However, I have what I was given, which isn't much. Any ideas how I can read in a file one line at a time and store it to a variable to see what the line is?
Thanks much in advance!
Jon
***CODE***
Code:
Dim cr As String
Dim hLogFile As Integer
Dim Temp As String
hLogFile = FreeFile
Temp = "c:\" + model + mdy + "count.txt"
Open Temp For Binary Access Write As hLogFile
Put hLogFile, , "Total Passed = " & countTotal & cr
Put hLogFile, , "Total Passed = " & countgood & cr
Put hLogFile, , "Total Failed = " & countreject & cr
'Enter fail modes and counts to hLogFile
For X = 1 To (failbottom - 1)
Put hLogFile, , failmode(X) & " " & failcount(X) & cr
Next X
Close hLogFile
There work out to be a total of about 24 fail modes put in after the total counts. My problem is that I need to populate a form/variables with the count for each failure mode. That is, I need to read in a line, see what fail mode it is, match it to a variable, and populate the count variable for that fail mode with the count read in the file. If it was me, I would have created a type, and put each fail mode in as a record, as the Get Statement has a variable for recnumber. However, I have what I was given, which isn't much. Any ideas how I can read in a file one line at a time and store it to a variable to see what the line is?
Thanks much in advance!
Jon