How can I add a CR LF

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default How can I add a CR LF

    Hi

    is it possibel to add a CR and LF after date in a string ie:

    the quick CR LF bronw fox

    so when a report is generated the CR and LF are put into action and the
    viewer would see
    the quick
    bronw fox

    Regards

    John Berman
    [email]john_berman@blueyonder.co.uk[/email]


    John Berman Guest

  2. #2

    Default Re: How can I add a CR LF

    TheString = "the quick" & vbCrLf & "bronw [sic] fox"


    If you're writing HTML though, a vbCrLf will only put a crlf in the source,
    which means nothing in HTML. Instead, you'd do:

    TheString = "the quick <br> bronw [sic] fox"

    Ray at work

    "John Berman" <John_berman@blueyonder.co.uk> wrote in message
    news:aEs1c.263$E%5.69@news-binary.blueyonder.co.uk...
    > Hi
    >
    > is it possibel to add a CR and LF after date in a string ie:
    >
    > the quick CR LF bronw fox
    >
    > so when a report is generated the CR and LF are put into action and the
    > viewer would see
    > the quick
    > bronw fox
    >
    > Regards
    >
    > John Berman
    > [email]john_berman@blueyonder.co.uk[/email]
    >
    >

    Ray at Guest

  3. #3

    Default Re: How can I add a CR LF

    sorry I was not to clear, the text is in a field within an acess database
    and so when I wite out the field I want to see the CR and LF actioned

    Regards


    John B


    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:edQgTxWAEHA.1036@TK2MSFTNGP10.phx.gbl...
    > TheString = "the quick" & vbCrLf & "bronw [sic] fox"
    >
    >
    > If you're writing HTML though, a vbCrLf will only put a crlf in the
    source,
    > which means nothing in HTML. Instead, you'd do:
    >
    > TheString = "the quick <br> bronw [sic] fox"
    >
    > Ray at work
    >
    > "John Berman" <John_berman@blueyonder.co.uk> wrote in message
    > news:aEs1c.263$E%5.69@news-binary.blueyonder.co.uk...
    > > Hi
    > >
    > > is it possibel to add a CR and LF after date in a string ie:
    > >
    > > the quick CR LF bronw fox
    > >
    > > so when a report is generated the CR and LF are put into action and the
    > > viewer would see
    > > the quick
    > > bronw fox
    > >
    > > Regards
    > >
    > > John Berman
    > > [email]john_berman@blueyonder.co.uk[/email]
    > >
    > >
    >
    >

    John Berman Guest

  4. #4

    Default Re: How can I add a CR LF

    sorry I was not to clear, the text is in a field within an acess database
    and so when I wite out the field I want to see the CR and LF actioned

    Regards


    John B


    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:edQgTxWAEHA.1036@TK2MSFTNGP10.phx.gbl...
    > TheString = "the quick" & vbCrLf & "bronw [sic] fox"
    >
    >
    > If you're writing HTML though, a vbCrLf will only put a crlf in the
    source,
    > which means nothing in HTML. Instead, you'd do:
    >
    > TheString = "the quick <br> bronw [sic] fox"
    >
    > Ray at work
    >
    > "John Berman" <John_berman@blueyonder.co.uk> wrote in message
    > news:aEs1c.263$E%5.69@news-binary.blueyonder.co.uk...
    > > Hi
    > >
    > > is it possibel to add a CR and LF after date in a string ie:
    > >
    > > the quick CR LF bronw fox
    > >
    > > so when a report is generated the CR and LF are put into action and the
    > > viewer would see
    > > the quick
    > > bronw fox
    > >
    > > Regards
    > >
    > > John Berman
    > > [email]john_berman@blueyonder.co.uk[/email]
    > >
    > >
    >
    >


    John Berman Guest

  5. #5

    Default Re: How can I add a CR LF

    "John Berman" wrote:
    : sorry I was not to clear, the text is in a field within an acess database
    : and so when I wite out the field I want to see the CR and LF actioned

    John...

    What is 'actioned'? If you want the carriage return/line feed to return the
    left margin and increment the row to the next line, then what Ray showed you
    does just that. You might have to adapt it to your application (field
    values) but he gave you the information you needed.

    If you want to write out a field value to the page and end it with a
    carriage return/line feed then you can use:

    If adj0 = quick and adj1 = dead...

    <%
    Response.Write("The " & rs("adj0") & "<br />" & vbCrLf & "and the " &
    rs("adj1") & ".")
    %>

    The result will be:
    The quick
    and the dead.

    Or you can use:

    The quick <%= rs("adj0") %><br />
    and the <%= rs("adj1") %>.

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - [url]http://www.microsoft.com/technet/scriptcenter/[/url]
    WSH 5.6 Documentation - [url]http://msdn.microsoft.com/downloads/list/webdev.asp[/url]
    MSDN Library - [url]http://msdn.microsoft.com/library/default.asp[/url]


    Roland Hall Guest

  6. #6

    Default Re: How can I add a CR LF

    Roland Hall wrote:
    > "John Berman" wrote:
    >> sorry I was not to clear, the text is in a field within an acess
    >> database and so when I wite out the field I want to see the CR and
    >> LF actioned
    >
    > John...
    >
    > What is 'actioned'? If you want the carriage return/line feed to
    > return the left margin and increment the row to the next line, then
    > what Ray showed you does just that. You might have to adapt it to
    > your application (field values) but he gave you the information you
    > needed.
    I think he's looking to replace carraige returns from a text field with line
    breaks:

    <%
    Private Function n3_LineBreak(str)
    If InStr(str,chr(13)) Then
    n3_LineBreak = Replace(str,chr(13),"<br />")
    Else
    n3_LineBreak = str
    End If
    End Function
    %>

    <%= n3_LineBreak(rs("YourField").value) %>

    --

    kindler chase
    [url]http://www.ncubed.com[/url]
    Home of SuperInvoice's Fortress of Solitude

    [url]news://news.ncubed.com/support[/url]
    n3 Support Group


    Kindler Chase Guest

  7. #7

    Default Re: How can I add a CR LF

    On Wed, 3 Mar 2004 19:14:42 -0700, "Kindler Chase"
    <billyboy@DELETE_ME_roubaixinteractive.com> wrote:
    >Roland Hall wrote:
    >> "John Berman" wrote:
    >>> sorry I was not to clear, the text is in a field within an acess
    >>> database and so when I wite out the field I want to see the CR and
    >>> LF actioned
    >>
    >> John...
    >>
    >> What is 'actioned'? If you want the carriage return/line feed to
    >> return the left margin and increment the row to the next line, then
    >> what Ray showed you does just that. You might have to adapt it to
    >> your application (field values) but he gave you the information you
    >> needed.
    >
    >I think he's looking to replace carraige returns from a text field with line
    >breaks:
    >
    ><%
    >Private Function n3_LineBreak(str)
    > If InStr(str,chr(13)) Then
    > n3_LineBreak = Replace(str,chr(13),"<br />")
    > Else
    > n3_LineBreak = str
    > End If
    >End Function
    >%>
    >
    ><%= n3_LineBreak(rs("YourField").value) %>
    Crap. I've been doing this for a long time and never stuck it in a
    clean function like this. Thanks for pointing out what a doofus I
    sometimes am. :)

    I've been doing Replace on each output line, which can get messy.

    Jeff
    Jeff Cochran Guest

  8. #8

    Default Re: How can I add a CR LF

    Jeff Cochran wrote:
    <snip>
    >> <%
    >> Private Function n3_LineBreak(str)
    >> If InStr(str,chr(13)) Then
    >> n3_LineBreak = Replace(str,chr(13),"<br />")
    >> Else
    >> n3_LineBreak = str
    >> End If
    >> End Function
    >> %>
    >>
    >> <%= n3_LineBreak(rs("YourField").value) %>
    >
    > Crap. I've been doing this for a long time and never stuck it in a
    > clean function like this. Thanks for pointing out what a doofus I
    > sometimes am. :)
    >
    > I've been doing Replace on each output line, which can get messy.
    >
    > Jeff
    lol - sure thing :)

    --

    kindler chase
    [url]http://www.ncubed.com[/url]
    Home of SuperInvoice: The Online Invoicing Application.
    Organize your billing process and impress your clients.

    [url]news://news.ncubed.com/support[/url]
    n3 Support Group


    Kindler Chase Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139