Hi, I am trying to shorten text I get from my database. I have this.
and also
I query the database and return many users. Many of the users have content in the "databasefi eld" I need to use an if in the html and have no idea how i should format it without getting error 500.
Any pointers would be great.
Thanks in advance
Richard
Code:
function shortString(ltext,textlength) if not isNull(ltext) then if len(lText) > textlength then lIndex = instrRev(left(lText,textlength)," ") if lIndex > -1 then retText = left(ltext,lIndex) & "..." else retText = left(ltext,textlength) & "..." end if else retText = lText end if else retText = "" end if shortstring = retText end function
and also
Code:
<%
myString = rs("databasefield")
myShortString = shortstring(mystring,125)
response.write(myShortString)
%>
Code:
<%
If not IsBlank(rs("databasefield")) Then %>
<p><%=rs("databasefield")%></p>
<%
End If
%>
Thanks in advance
Richard
Comment