Carriage return detection

Results 1 to 4 of 4

Thread: Carriage return detection

  1. #1
    Tony Guest

    Default Carriage return detection

    I need to detect a carriage return, so that I can break up a paragraph of text being passed from one page to another. I have attempted this several ways, but nothing seems to work (I am rather new to this). Any ideas??

  2. #2
    Join Date
    Dec 1969

    Default RE: Carriage return detection

    I do it using a little piece of VBScript in my ASP page.... Here is the code :<BR><BR>function CRtoBR(lstrIn)<BR><BR>dim lstrOutput<BR>dim lCount<BR>dim lstrChar<BR><BR>for lCount = 1 to len(lstrIN)<BR> <BR>lstrChar = mid(lstrIn,lCount,1)<BR><BR>if asc(lstrChar) &#060;&#062; 13 then<BR> lstrOutput = lstrOutput & lstrChar<BR>else <BR> lstrOutput = lstrOutput & "<BR>" <BR>end if <BR><BR>next <BR><BR> CRtoBR = lstrOutput <BR><BR>end function<BR><BR>All you then need to do is apply the function around the tag.. i.e :<BR><BR>CRtoBR(request("formname"))<BR><BR>Enjoy !

  3. #3
    Join Date
    Dec 1969

    Default RE: Carriage return detection

    You need to search for carriage return chr(13) and line feed chr(10) in the string. I&#039ve done this by <BR>Dim str1<BR>str1 = chr(13) & chr(10)<BR>

  4. #4
    paul_merton @ Guest

    Default RE: Carriage return detection - opinions?

    normally, I do the following...<BR><BR>stringName = Request("something")<BR>stringName = replace(replace(stringName, chr(13), "<BR>"), chr(10), "")<BR><BR>BUT, is it correct to assume this though methodology, as Unix (and other) OS&#039s just normally use chr(10) as a line break - so would it be wiser to check for that? Any opinions anyone?<BR><BR>Chars,<BR>paulos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts