① # This character can be followed by A character encoding. The character encoding can be expressed in decimal or hexadecimal notation. For example, the character "A" is encoded in 65 (decimal) or $41 (hexadecimal ).
---------------------------------
Var
C: AnsiChar;
Begin
C: = #65;
ShowMessage (c); {}
C: = # $41;
ShowMessage (c); {}
End;
For more information about anⅱ coding, see (http://www.cnblogs.com/28088191/archive/2008/06/13/1220352.html)
--------------------------------
② # Can also represent double byte characters, all Chinese character encoding see (http://www.cnblogs.com/28088191/archive/2008/06/13/1220366.html)
Var
Wc: WideChar;
Begin
Wc: = # $ 732B;
ShowMessage (wc); {cat}
Wc: = 29483;
ShowMessage (wc); {cat}
{Dual-byte compatible single-byte}
Wc: = #65;
ShowMessage (wc); {}
Wc: =#$ 41;
ShowMessage (wc); {}
End;
------------------------------------------
③ When multiple # characters are connected, the plus sign (+) can be omitted, indicating that the characters are connected. This is commonly used in SQL statements.
--------------------------------------------
Var
Str: string;
Begin
Str: = #65 + #66 + #67;
ShowMessage (str); {ABC}
Str: = #65 #66 #67;
ShowMessage (str); {ABC}
Str: = 'cat '+ #32 + #68 + #101 + #108 + #112 + #104 + #105 + #32 + 'blog ';
ShowMessage (str); {Cat's Delphi blog}
Str: = 'cat's #32 #68 #101 #108 #112 #104 #105 #32 'blog ';
ShowMessage (str); {Cat's Delphi blog}
End;
---------------------------------------
The SQL statement is used as follows:
-------------------------
Var SQL: String;
SQL: = 'select * From table Where Date Field Between # '+ DateTimeToStr (DateTimePicker1.Date) +' # And # '+ DateTimeToStr (DateTimePicker2.Date) + '#';