what is vbCr in vb 2010 ? And, must we add vbCr to send a string to serialport ?

i want to send and receive at command to my phone using vb

sort by: active | newest | oldest
g-one7 years ago
I only can give you the answer to your first question. vbCr is a VB constant that contains the Carriage Return character ( same like Chr(13) ). Carriage Return lets jump the cursor to the beginning of the current line. A normal line breake in Windows needs a Carriage Return followed by a Line Feed Chr(10) . VB knows the constant vbCrLf to generate both characters.

But I have really no idea if you would need a vbCr to separate data for your command or what ever ...
Rendydevara (author)  g-one7 years ago
Thank you

so, i got this code from a website
.............................
.............................
SerialPort1.WriteLine(data & vbCr)
.............................
.............................

for what is vbCr in serial port ?
This construct makes no sense to me. WriteLine appends CR and LF automatically to your string in "data". No idea what an additional CR could be good for.
Rendydevara (author)  g-one7 years ago
Thank you
i understand now

but how to add a Carriage Return in C# ?
I'm not familar with C# but as far as I remember it should be "\r" for Carriage Return and "\n" for Line Feed.