-
Ok, I know there HAS to be a better way to do this.
Code:
If InStr(Form8.Text1.Text, "Error 301") > 0 Then
If AddList = 1 Then
AddList = 0
List4.AddItem "[" & ErrorCurrentURL & "] at " & Time
List1.AddItem StartError & ErrorCurrentURL ">" & ErrorCurrentURL & MiddleError & "Error: Moved Permanently</a> - " & Format(Now, "h:mm AM/PM") & " - " & Format(Date, "mm/d/yy") & EndError
End If
Timer1.Enabled = False
End If
If InStr(Form8.Text1.Text, "Error 404") > 0 Then
If AddList = 1 Then
AddList = 0
List4.AddItem "[" & ErrorCurrentURL & "] at " & Time
List1.AddItem StartError & ErrorCurrentURL ">" & ErrorCurrentURL & MiddleError & "Error: Page Not Found</a> - " & Format(Now, "h:mm AM/PM") & " - " & Format(Date, "mm/d/yy") & EndError
End If
Timer1.Enabled = False
End If
I would have to make 20 some odd of those if statements to check for different errors, is there a way to set the errors and variables and also the discription of the error to go with it. The "Error 404" error goes with the "Page Not Found" discription, etc.
Thanks in advance,
------------------
Ryan French
Niresoft Incorporated
http://www.niresoft.com
[email protected]
-
Try this:
- Create a text (error.txt) file with the errors you want to check in it.
- On form_load input from the text file to an array of a custom type. Like:
Private Type ListErrors
ErrorCode As String
ErrorMeaning As String
End Type
Dim ErrorCheck() as ListErrors
- Create a function with a For Next statement until the UBound of the array you created.
With a dozen of lines of code you do it and then with just a call to a func you have your result.
If you have any problem creating this e-mail me.
------------------
Jorge Ledo
[email protected]
Portugal
[This message has been edited by JorgeLedo (edited 02-08-2000).]
-
The errors must be built in, that way the user can't mess it up in any way.
-
You probably want to use a resource file to store the error messages. It will take me a little while but I will create a demo project for you and email it to you.
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"