This section describes the utility script library file to be used as an include file for the main ASP script page.
In order to make the guest book main script easier to maintain,
I have moved all utility functions into a separate library file, _library.inc:
Function myTrim(sText,nLen)
myTrim = sText
If myTrim <> "" Then
myTrim = Trim(sText)
If Len(myTrim) > nLen Then
myTrim = Mid(myTrim, 1, nLen)
End If
End If
End Function
Function removeHTML(strText)
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
End Function
Function htmlNotice(sText)
Response.Write("<table class=hy_notice cellspacing=0" _
& " cellpadding=5>")
Response.Write("<tr><td>" & sText & "</td></tr>")
Response.Write("</table>")
End Function
Function htmlError(sText)
Response.Write("<table class=hy_error cellspacing=0" _
& " cellpadding=5>")
Response.Write("<tr><td>" & sText & "</td></tr>")
Response.Write("</table>")
End Function
Function myDump
aKeys = hgRqParam.Keys()
ogDebug.WriteLine("Values in hgRqParam:")
For i=0 To hgRqParam.Count-1
k = aKeys(i)
ogDebug.WriteLine(k & " = (" & hgRqParam.Item(k) & ")")
Next
aKeys = hgPgParam.Keys()
ogDebug.WriteLine("Values in hgPgParam:")
For i=0 To hgRqParam.Count-1
k = aKeys(i)
ogDebug.WriteLine(k & " = (" & hgPgParam.Item(k) & ")")
Next
End Function
%>