Hey guys and gals... just wondering if you know how I can make a newline when printing data. I know in C/C++ it's ENDL or "\n", but how do I do this with Visual Basic?
Thanks ;)
Printable View
Hey guys and gals... just wondering if you know how I can make a newline when printing data. I know in C/C++ it's ENDL or "\n", but how do I do this with Visual Basic?
Thanks ;)
Hi,
dim EndOfLine as string
EndOfLine = chr(13) & chr(10) ' = \n
'if you want to print something like
'Hello\nWorld
debug.print "Hello" & EndOfLine & "World"
bye
__Neph__
Thanx, except that has problems in VB5... I figured it out myself just a few min ago... you gotta use the built in VB control vbcrlf
peace
hey Alex use these...
Constant Equivalent Description
vbCrLf Chr(13) + Chr(10) Carriage return–linefeed combination
vbCr Chr(13) Carriage return character
vbLf Chr(10) Linefeed character
vbNewLine Chr(13) + Chr(10) or Chr(13) Platform-specific new line character; whichever is appropriate for current platform
vbNullChar Chr(0) Character having value 0
vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures
vbTab Chr(9) Tab character
vbBack Chr(8) Backspace character
vbFormFeed Chr(12) Not useful in Microsoft Windows
vbVerticalTab Chr(11) Not useful in Microsoft Windows
so put in a vbCrLf instead of chr(13) + chr(10)... VB will replace the constant at runtime (compile-time) but it makes the code MUCH more readable !
phil :)
ps check out the 'constants' section under help... it will open your eyes to a lot of things you can do in VB
hey Alex use these...
Constant Equivalent Description
vbCrLf Chr(13) + Chr(10) Carriage return–linefeed combination
vbCr Chr(13) Carriage return character
vbLf Chr(10) Linefeed character
vbNewLine Chr(13) + Chr(10) or Chr(13) Platform-specific new line character; whichever is appropriate for current platform
vbNullChar Chr(0) Character having value 0
vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures
vbTab Chr(9) Tab character
vbBack Chr(8) Backspace character
vbFormFeed Chr(12) Not useful in Microsoft Windows
vbVerticalTab Chr(11) Not useful in Microsoft Windows
so put in a vbCrLf instead of chr(13) + chr(10)... VB will replace the constant at runtime (compile-time) but it makes the code MUCH more readable !
phil :)
ps check out the 'constants' section under help... it will open your eyes to a lot of things you can do in VB