EirikDaude
09-26-2014, 04:17 AM
I am adding new text/captions to some different objects. I want to have linebreaks in the text in question, and tried using something like:
"text" + vbNewLine + "more text"
Since that seemed to be what made the code easiest to read. However, that seems to insert two "newlines", at least when it comes to titles in charts. I figured I should have a look at what other options I have, and according to a different site (http://www.developerfusion.com/thread/23605/carriage-return-line-feed-chars), these are the options for linebreaks in VB(A):
vbCrLf = "\n" # Carriage returnlinefeed combination
vbCr = chr(13) # Carriage return character
vbLf = chr(10) # Linefeed character
vbNewLine = "\n" # Platform-specific new line character; whichever is appropriate for current platform
However I have some difficulty with learning what's the difference between a linefeed and a carriage return, and why one usually (?) combine them. I am guessing that this may be the reason I get one more new line than I want in some circumstances with vbNewLine, because the native new line character is similar to vbCrLf?
Anyway, I don't really have all that much trouble in getting the results I want, I'll just play around a bit with the two other options I have. But I got a bit curious, and would very much appreciate it if someone could give me a bit more information on what the differences between the options are, and if there are any which are more suitable than others?
"text" + vbNewLine + "more text"
Since that seemed to be what made the code easiest to read. However, that seems to insert two "newlines", at least when it comes to titles in charts. I figured I should have a look at what other options I have, and according to a different site (http://www.developerfusion.com/thread/23605/carriage-return-line-feed-chars), these are the options for linebreaks in VB(A):
vbCrLf = "\n" # Carriage returnlinefeed combination
vbCr = chr(13) # Carriage return character
vbLf = chr(10) # Linefeed character
vbNewLine = "\n" # Platform-specific new line character; whichever is appropriate for current platform
However I have some difficulty with learning what's the difference between a linefeed and a carriage return, and why one usually (?) combine them. I am guessing that this may be the reason I get one more new line than I want in some circumstances with vbNewLine, because the native new line character is similar to vbCrLf?
Anyway, I don't really have all that much trouble in getting the results I want, I'll just play around a bit with the two other options I have. But I got a bit curious, and would very much appreciate it if someone could give me a bit more information on what the differences between the options are, and if there are any which are more suitable than others?