Results 1 to 4 of 4

Thread: Difference between VbCrLf and VbLf

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    57

    Difference between VbCrLf and VbLf

    Ok, i'm encountering some problem with the use of VbCrlf (Carriage Return LineFeed Combination) with my richedit control, as an alternative, i plan to force my RichEdit control to use VbLf (linefeed, chr(10)) using code, whenever the user presses the "ENTER" key on their keyboard

    The end result is that i get less error with VbLf and my app have no error anymore, i notice there's not much difference between the two as well, but just for safety's sake , can anyone tell me the difference between them?

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    The difference is mainly that in dos, you only use a chr$(10) while in windows you use both a chr$(13) & chr$(10) to format line breaks. In the richtext control, when interpreting a file with just linefeeds (chr(10)), it will automatically add the matching carriage returns (this is why wordpad can read dos and unit text with the lines formated correctly, while notepad cannot.) I would guess, that if you were to save the information in your Richtextbox, you will find that the Richtextbox will automatically add the chr(13) & chr(10) combinations to all your line breaks. At least that is my experience.

  3. #3
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    vbCrLf = Carriage Return AND Line Feed (Chr(13) And Chr(10))

    vbLf = Only Line Feed (Only Chr(10))

    vbTab = Tab (Chr(9))

    vbBack = Backspace (Chr(8))

    vbCr = Only Carriage Return (Chr(13))

    vbFormFeed = FormFeed (Chr(12))

    vbNewLine = A platform specific vbCr or vbLf or vbCrLf or vbFormFeed

    vbNullChar = Null (Chr(0))

    vbNullString = For API's requiring Null String Paramater

    vbObjectError = Error from your custom class (Object).

    vbVerticalTab = Vertical Tab (Chr(11))

    r0ach™
    Don't forget to rate the post

  4. #4

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    57

    Cool , Thanks :)

    Looks like it should be safe to use vbLF after all, since it'll auto create the CarriageReturn (if that's what you mean) when saving then my app shouldn't encounter any compatibility problem at all.

    Thanks

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