# Usage

Source: Internet
Author: User
① # 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) + '#';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.