No.1 Include file in Delphi
begin
ShowMessage({$I File1.txt}; //Is there something wrong?
ShowMessage(UpperCase({$I File1.txt});
end;
//Create a new text file "File1.txt" and fill in the content as: "'Hello Word')" Take a look
No.2 Cute forced conversion
var B: Byte
begin
Char(B) := 'A'; //We usually write B := Byte('A');
end;
No.3 Subscript of constant expression
Catpion := 'you'[1] + 'good'[2]; //What is it?
No.4 Characters expressed by carets
Caption := ^:^3^7^!^.^'; //This sentence can be written correctly
refer to
http://www.csdn.net/Expert/TopicView1.asp?id=658958
No.5 Non-integer types are subscripted
var A: array[Char] of Byte; //I guess many people know this
No.6 Inc() not only handles integers plus one
var C: Char;
begin
C := 'A';
Inc(C); //That’s right
end;
No.7 "X[:X[:X]]" format
var S: string;
begin
Str(123456.7890:0:2, S); //Most people who learn Delphi directly will not know
Caption := S;
end;
No.8 System prompts, you can make good use of it
begin
{$MESSAGE HINT 'Take a look'}
end;