hi,
Look at the code below and corresponding output.
VB Code:
System.Console.Write("Invalid string "+ Convert.ToChar(13) + " Test");
output.
Testid string
Anyone can explain ?
edit
never mine this I just got it.
thanks,
Printable View
hi,
Look at the code below and corresponding output.
VB Code:
System.Console.Write("Invalid string "+ Convert.ToChar(13) + " Test");
output.
Testid string
Anyone can explain ?
edit
never mine this I just got it.
thanks,
That's really weird.. :confused:
I tried it with a few different strings, and found out really weird stuff.
Appearantly the Convert.ToChar(13) causes the console to go back to the beginning of the line and write the second string. So the second string overwrites the first one.
change 13 to 10 so that console will go to the next line. but in delphi before i used 13 and no issue.
13 is a carriage return and 10 is a line feed. They are based on old type-writers. I'm not sure whether you guys are youngsters and don't remember them but if you were using a type-writer and you returned the carriage without feeding the paper to the next line then you'd simply write over the top of the last line. What you're seeing with that output is EXACTLY what those two control characters were designed to do.
I'm a bit of a youngster, but I remember typewriters :p
Cool to know :)