Results 1 to 10 of 10

Thread: purpose of vbCrLf

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    4

    purpose of vbCrLf

    what is the purpose of vbcrlf

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: purpose of vbCrLf

    It is a predefined constant you can use. It is more convenient to use than Chr$(13) & Chr$(10) - CR = 13, LF = 10. However, vbNewLine is a slightly faster alternative (for an unknown reason). vbCrLf can be considered more readable in other situations (it tells what characters are being added) while vbNewLine may be better in others (it tells that a line changes). In the end you can just use whichever one you find more convenient.

  3. #3

  4. #4
    Fanatic Member Dungeon Keeper's Avatar
    Join Date
    Mar 2008
    Posts
    590

    Re: purpose of vbCrLf

    Quote Originally Posted by preetesh View Post
    what is the purpose of vbcrlf
    In other words, the text that comes after it will be "written" in a new row

    Code:
    Debug.Print "First row" & VbCrLf & "Second Row" & VbCrLf & "Third row"
    will output

    Code:
    First row
    Second Row
    Third row
    No, that wont do!

  5. #5
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    Re: purpose of vbCrLf

    It can be quite useful when you want to display a multi-lined messagebox.

  6. #6
    New Member VBNov's Avatar
    Join Date
    Jan 2010
    Location
    Oklahoma
    Posts
    8

    Re: purpose of vbCrLf

    All is fun and games til you try that code and it doesn't work and you wonder why? Then you figure out that you have to turn the Multiline property to true and not false. Hahaha.
    Wouldn't it be nice if you have made a mistake in your life, you could just press Ctrl' Alt' Delete'!!!!

  7. #7
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: purpose of vbCrLf

    vbCrLf is also a command that must follow most Modem AT Commands.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  8. #8
    Hyperactive Member Condomx's Avatar
    Join Date
    Dec 2009
    Location
    Iligan City,Philippines
    Posts
    327

    Re: purpose of vbCrLf

    AS FAR AS I KNOW...IT IS USE FOR MAKING A NEWLINE..LIKE & VbCrlf & and so on..
    ~[L!f3 !s @ll @ab0ut l3@rn!ng]~

    ~*D0nt Give up, h0pe is always present*~

  9. #9
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: purpose of vbCrLf

    Interestingly, this command dates back to the Teletype Machine.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: purpose of vbCrLf

    Bit of trivia -
    CR = Carriage Return .... returns the carriage (think typewriters or teletypes) back to the beginning of the line... does not advance to the next line... which is why there is the...
    LF = Line Feed ... advances the paper one line.... but does not return the carriage to the beginning of the line... which is why...

    We have CRLF today... the two commands together return the carriage to the start position and then advance the paper one line.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Click Here to Expand Forum to Full Width