'************************************** ' Name: WraptIt ' Description:This is a function to prov ' ide word wrap capability in your ASP pag ' es. ' By: Chip Taylor (from psc cd) ' ' ' Inputs:Function takes a string, a colu ' mn number, and a forced break boolean. I ' f the forced break boolean is FALSE (def ' ault) then the string will wrap at the n ' earest end-of-word to the column number. ' If TRUE then the string will wrap at the ' column number regardless of end-of-word ' ' Returns:A string with embedded <br> ta ' gs to provide word wraps. ' 'Assumes:None ' 'Side Effects:None '************************************** Function WrapIt(varString,varNumChar,boolBreak) ' Word Wraps a string varString at end o ' f word nearest column position varNumCha ' r ' If boolBreak is true then the wrap wil ' l take place at position varNumChar rega ' rdless varString=Trim(varString) varSetBR = "<br>" result="" varString=Replace(varString,chr(13)+chr(10),chr(10)) while varString<>"" if len(varString)<=varNumChar then line=varString varString="" else varTemp1=left(varString,varNumChar) iCount=InStrRev(varTemp1," ") varInPlace=InStr(varTemp1,"chr(10)") if (iCount=0) and not boolBreak then iCount=InStr(varString," ") if (varInPlace=0) and not boolBreak then varInPlace=InStr(varString,chr(10)) if (varInPlace<iCount) and (varInPlace>0) then finish=j-1 start=varInPlace+1 elseif iCount=0 then finish=varNumChar start=varNumChar+1 else finish=iCount start=iCount+1 end if line=left(varString,finish) varString=ltrim(mid(varString,start)) end if 'if result="" then result=line else result=result&chr(10)&line wend if left(result,1) = chr(10) then result = right(result,(len(result)-1)) end if WrapIt=Replace(result,chr(10),varSetBR) end function