ASP Tutorials - Herong's Tutorial Examples - v5.10, by Dr. Herong Yang
The Utility Script Library File
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
%>
Table of Contents
ASP (Active Server Pages) Introduction
IIS (Internet Information Services) 5.0
Managing Sessions with and without Cookies
scrrun.dll - Scripting Runtime DLL
Managing Response Header Lines
Calculation Speed and Response Time
Working with MS Access Database
►Guest Book Application Example