%@LANGUAGE="VBScript"%>
LogFil for Branndokumentasjon signatur
Text Log fil til branninstrukser
<%
'Sorting the array in LogFile
Function SortArray(anyArray)
    If IsArray(anyArray) Then
        For i = intLineNum To 0 Step -1
          For j = 0 To i - 1
             if not isNull(anyArray(j)) then           
                If anyArray(j) > anyArray(j + 1) Then
                    tmp = anyArray(j)
                    anyArray(j) = anyArray(j + 1)
                    anyArray(j + 1) = tmp        			
                End If
              End if
            Next
        Next
    SortArray = anyArray
    End If
End Function
%>
<%
'Uppdates the LogFile
strTextFile = Server.MapPath("BrannLog.txt")
'create an instance of a FileSytemObject object
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'look for a command sent from the FORM section buttons
If Len(Request.Form("cmdUpdate")) Then
    'write out contents of TEXTAREA to file
     strNewText = Request.Form("txtContent")
     arrLines = Split(strNewText, vbCrLf)
     Set objTStream = objFSO.OpenTextFile(strTextFile, ForWriting)
     For intLine = 0 To UBound(arrLines)
        strThisLine = arrLines(intLine)
        If Len(strThisLine) > 4 Then objTStream.WriteLine Mid(strThisLine, 1)
     Next
     objTStream.Close
End If
%>