Results 1 to 5 of 5

Thread: linefeed and carrage return

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329

    linefeed and carrage return

    ok, my first question is about line feed.
    could someone explain what line feed is and when i use it?
    i know i can use vbCr for a new line
    what is the difference between it and vbCrLf?
    how bout just vbLf?


    thanks!
    ______________

  2. #2
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    okay Carraige Return and Line Feed are related like this

    vbcr is actually just a static variable with the ASC value of the enter key

    VbLF is a static variable containing the Asc code for a Line Feed

    now

    If you were to just place the asc value for a carraige return on in a text box you would only end up with something like a square box displayed

    the reason for this is beacuase

    vb uses the carraige return to indicate the end of a line of text
    it uses the linefeed to actaully feed the curser down to the begining of the next line

    This is important beacuase if you want to go and parse the text file you can quickly and easily find the end of each line by finding the carraige return charactors

    Also most objects and controls in vb do the same thing when searching a line

    Notice in MS word if you display those gizmos that show you when you have tabbed and hit return??

    well they are finding the same charactors

    So you should always end a line with Vbcrlf or with Chr$(13) & Chr$(10)

  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    an Lf on it's own is when a line of text stops but continues on the immediate next line. Cr is a carriage return (as if you pressed Enter on the keyboard) and CrLf is a combination of both that Windows favours

  4. #4
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    From webopedia:

    carriage return - Often abbreviated CR, a carriage return is a special code that moves the cursor (or print head) to the beginning of the current line. In the ASCII character set, a carriage return has a decimal value of 13.
    line fee - Often abbreviated LF, a line feed is a code that moves the cursor on a display screen down one line. In the ASCII character set, a line feed has a decimal value of 10.

    On printers, a line feed advances the paper one line. Some printers have a button labeled LF that executes a line feed when pressed. (Note, however, that the printer must be in off-line mode to execute a line feed.)
    There is also vbNewline which does a combination of vbCrLF or vbLF depending on the Platform. Hope this helps.
    seoptimizer2001
    VB 6.0, VC++, VI, ASP, JavaScript, HTML,
    Perl, XML, SQL Server 2000

    If God had intended us to drink beer, He would have given us stomachs.


    Please use the [code] and [vbcode] tags in your posts!
    If you don't know how to use them please go HERE!


  5. #5
    vbGrandpa
    Guest
    When you press the "Enter" key you send a carriage return
    (chr(13)) to the system. The system recognizes the carriage
    return and sends a line feed (chr(10)) to the file in question.

    Someone correct me if i'm wrong.......it's happened many times.

    Grandpa

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