<%
Option Explicit
On Error Resume Next
Response.Write FirstName("Jan")
Function FirstName (FullName)
   If InStr(FullName, " ") = 0 Then
     Err.Raise vbObjectError + 22, "MyFunction.FirstName", _
       " Parametr FullName tej funkcji musi zawiera spacj!"
   Else
     FirstName = Left(FullName, InStr(FullName, " ") - 1)
   End If
End Function

If err.number <> 0 Then
   Dim objFileSys
   Dim ObjErrorFile
   set objFileSys = Server.CreateObject("Scripting.FileSystemObject")
   set objErrorFile = objFileSys.OpenTextFile("e:\inetpub\errorfile.txt", 8, True)
   objErrorFile.WriteLine Err.number & " - " & Err.Description & " - " _
     & Err.Source & " - " & Now & " - " & Request.ServerVariables("Script_Name")
  Response.Write "Bd zosta zarejestrowany w pliku dziennika. Zlokalizujemy" _
     & "problem tak szybko, jak to tylko bdzie moliwe."
End If
%> 
