pcode for the parser
Public Function Parser(ByVal strLogFileName)
'this will be contained in a module, separate from the form code
' the main form click event (when user selects the log file?)
' will call this function, passing the log file name as a string
On Error GoTo Err_Oh_Crap
Dim strTempVar
Dim theObject, orTheArray ' ?
' open the file for reading
' open strLogFileName
While Not EOF
' begin parsing each line ... using Left$()
' assigning values to the object props or array items
' put the comma's into strTempVar
Loop
' successful read/parse of log file
' return value to calling form
Parser = True
Err_Exit_The_Parser:
Exit Function
Err_Oh_Crap:
' let user know there was an error
MsgBox "The log file could not be parsed ... or something", _
vbCritical + vbOKOnly, "Oh crap!"
' set return val of function to signify an error
Parser = False
Resume Err_Exit_The_Parser
End Function
'this will be contained in a module, separate from the form code
' the main form click event (when user selects the log file?)
' will call this function, passing the log file name as a string
On Error GoTo Err_Oh_Crap
Dim strTempVar
Dim theObject, orTheArray ' ?
' open the file for reading
' open strLogFileName
While Not EOF
' begin parsing each line ... using Left$()
' assigning values to the object props or array items
' put the comma's into strTempVar
Loop
' successful read/parse of log file
' return value to calling form
Parser = True
Err_Exit_The_Parser:
Exit Function
Err_Oh_Crap:
' let user know there was an error
MsgBox "The log file could not be parsed ... or something", _
vbCritical + vbOKOnly, "Oh crap!"
' set return val of function to signify an error
Parser = False
Resume Err_Exit_The_Parser
End Function
1 Comments:
:o)
Post a Comment
<< Home