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!
Printable View
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!
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)
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
From webopedia:
Quote:
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.
There is also vbNewline which does a combination of vbCrLF or vbLF depending on the Platform. Hope this helps.Quote:
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.)
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 :D