Code that is not expected in Delphi

xiaoxiao2021-03-06  110

No.1 Delphi in the include file

Begin

ShowMessage ({$ I file1.txt}; // Is it wrong?

ShowMessage (Uppercase);

END;

// Newly build a text file "file1.txt", the content is filled in: "'Hello Word')"

NO.2 cute forced conversion

VAR B: BYTE

Begin

Char (b): = 'a'; // We usually write B: = byte ('a');

END;

No.3 Subscription of constant expression

CATPION: = 'You' [1] 'Good' [2]; // What?

NO.4 Die characterized characters

CAPTION: = ^: ^ 3 ^ 7 ^! ^. ^ '; // This sentence can not be written

reference

http://www.9cbs.net/expert/topicview1.asp?id=658958

NO.5 non-integer type as subscript

Var A: Array [char] of byte; // Estimate a lot of people know

No.6 inc () not only handle integers

Var C: char;

Begin

C: = 'a';

INC (c); // is right

END;

No.7 "x [: x [: x]]" format

Var s: string;

Begin

STR (123456.7890: 0: 2, s); // Directology Delphi people will not know

Caption: = S;

END;

No.8 System Tips, you can use it well

Begin

{$ Message Hint 'Take a look'}

END;

转载请注明原文地址:https://www.9cbs.com/read-96959.html

New Post(0)