Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
What is Chr(13) and Chrw(13)? Is chr(13) used in VB or C#?
Posted

In VB,

SQL
Chr(13) = Carriage Return - (moves cursor to lefttmost side)
ChrW(13) = New Line (drops cursor down one line/ Enter)


The combination of both is used to start typing at the begining of a new line.

http://answers.yahoo.com/question/index?qid=20090216120257AADuYZG[^]

http://bytes.com/topic/visual-basic-net/answers/366833-microsoft-visualbasic-chrw[^]
 
Share this answer
 
v3
Comments
Member 3822764 10-Apr-19 13:43pm    
CAUTION! This answer is not correct.

The two clauses in the answer - Char(13) and ChrW(13) - are exactly equivalent in .Net, and equate to an ASCII Carriage Return (ASCII 13, (0x0D)).

For the second one to be a New Line (Line Feed), it would be ASCII 10 (0x0A), or to use ChrW to get the job done, it would be ChrW(10).

The only difference between Chr and ChrW is that ChrW allows for values bigger than 255 to be evaluated, returned as Wide (hence the 'W') characters (I.e., Unicode characters).
Basically, Chr(13) and ChrW(13) are equal.

But ChrW accepts unicode characters, and Chr only ANSI and converts any integer value from 0 to 255 using the current code page to a Char

more information on msdn: Chr, ChrW Functions

Chr(256) is not allowed, but ChrW(256) is OK (256 is only an example outside range 0-255, I do not know which symbol is behind the unicode char 256)
 
Share this answer
 
The valid range for Chr is 0 through 255,

and


the valid range for ChrW is -32768 through 65535.



Chr(13) = Carriage Return - (moves cursor to lefttmost side)

Microsoft.VisualBasic.ChrW(13) is "enter"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900