Problem Source: http://www.cnblogs.com/del/archive/2008/05/19/1089944.html#1203165
1. # This character can be represented by a character encoding followed by a decimal or hexadecimal character encoding;
For example, the character "a" is encoded in 65 (decimal) or $41 (hexadecimal ).
For more information about anⅱ coding, see http://www.cnblogs.com/del/archive/2007/12/07/987071.html.
var c: AnsiChar;begin c := #65; ShowMessage(c); {A} c := #$41; ShowMessage(c); {A}end;
2, with # can also represent double byte characters, all Chinese character encoding see: http://www.cnblogs.com/del/archive/2007/12/15/996290.html
VaR WC: widechar; begin WC: = #19975; showmessage (WC); {tens of thousands} WC: =#$ 4e07; showmessage (WC ); {tens of thousands} {dual-byte compatible single-byte} WC: = #65; showmessage (WC); {A} WC: =#$ 41; showmessage (WC ); {A} end;
3. When multiple # characters are connected, the + number can be omitted.
VaR STR: string; begin STR: = #65 + #66 + #67; showmessage (STR); {ABC} STR: = #65 #66 #67; showmessage (STR); {ABC} STR: = 'in case '+ #32 + #68 + #101 + #108 + #112 + #104 + #105 + #32 + 'blog'; showmessage (STR ); {In case of Delphi blog} STR: = 'in case of '#32 #68 #101 #108 #112 #104 #105 #32 'blog'; showmessage (STR ); {In case of Delphi blog} end;
In addition, the system unit has a constant slinebreak, which indicates the carriage return and line feed;
Enter #13 and line feed #10, so the slinebreak value is #13 #10;
When we enter the prompt, slinebreak = # $ D # $ A is displayed, but it is displayed in hexadecimal format.