Displaying Source Code(s)
|
|
cutOff
--------------------------------------------------------------------------------
Description : This function allows you to control the length of
a string. The function adds "..." to the end of an adjusted
string to indicate that it has been truncated.
<%
function cutOff(chkString,sNum)
'Is the string empty?
if IsNull(chKString) = False And chkString > sNum Then
strTot = Len(chkString)
'Eliminate blank spaces off the end, nee
' ded for SQL 6.5
While Right(chkString, 1) = " "
chkString = Left(chkString, strTot - 1)
strTot = Len(chkString)
Wend
'Cut it down
chkString = Left(chkString, sNum)
'One last check for blank spaces
if Right(chkString, 1) = " " Then
chkString = Left(chkString, sNum - 1)
End if
'Indicate truncation
if Len(chkString) <> strTot Then chkString = chkString & "..."
'Return string
cutOff = chkString
End if
End function
%>
|
|
|