<% function returnIf(state, ifTrue, ifFalse) dim returnValue if not isNull(state) then if cBool(state) then returnValue = ifTrue else returnValue = ifFalse end if else returnValue = ifFalse end if returnIf = cStr(returnValue) end function function getFileTextAbsolute(absolutePath) getFileTextAbsolute = getFileTextByMethod(absolutePath, true) end function function getFileText(relativePath) getFileText = getFileTextByMethod(relativePath, false) end function function getFileTextByMethod(thisPath, isAbsolutePath) dim fileSystem dim fileHandle dim absolutePath dim fileText set fileSystem = Server.CreateObject("Scripting.FileSystemObject") if not isAbsolutePath then absolutePath = Server.mapPath(thisPath) else absolutePath = thisPath end if set fileHandle = fileSystem.openTextFile(absolutePath) fileText = fileHandle.ReadAll fileHandle.close set fileHandle = nothing set fileSystem = nothing getFileTextByMethod = cStr(fileText) end function sub setFileText(relativePath, fileText) const overwrite = true dim fileSystem, fileHandle, absolutePath absolutePath = Server.mapPath(relativePath) set fileSystem = Server.Createobject("Scripting.FileSystemObject") set fileHandle = fileSystem.createTextFile(absolutePath, overwrite, 0) fileHandle.write fileText fileHandle.close set fileHandle = nothing set fileSystem = nothing end sub function toProperCase(parText) dim text text = uCase( left(parText, 1) ) & lCase( mid(parText, 2) ) toProperCase = text end function Function getTextBetween(text, startsWith, endsWith) Dim textBetween dim startI dim endI textBetween = "" startI = InStr(1, text, startsWith) If startI >= 1 Then startI = startI + Len(startsWith) endI = InStr(startI, text, endsWith) If endI >= 1 Then textBetween = Mid(text, startI, endI - startI) End If End If getTextBetween = cStr(textBetween) End Function function cutExtension(parFileName) dim fileName dim dot fileName = parFileName dot = inStr(fileName, ".") if dot >= 1 then fileName = left(fileName, dot - 1) end if cutExtension = cStr(fileName) end function %>