I have recently seen Li Wei's
Function WindowProc (Window: hwnd; wparam: wparam; lparam: lparam): LRESULT; stdcall;
I don't know if you think about a problem: in Delphi is not case sensitive, that is to say that the variable name and type name in the statement here. And when you study Pascal, C / C , the teacher often said to us can't say Go to the keyword as a variable name, why can you use it here?
I was confused when I first saw it, so I gave a DEPHI7
In
Directives are words that are sensitive in specific locations within source code. Deriectives have special meanings in the Delphi language, but unlike reserved words, appear only in contexts where user-defined identifiers can not occured.Heance-although it is inadvisable to do so-you The CAN Define An Identifier That Looks Exactly Like A Directive. That is to say that the retention word is used as a variable name.
This explains why WPARAM: WPARAM is allowed in the previous function declaration; this statement. By the way, Li Wei is in the "INSIDE VCL> book" Page 31 of the small word "C / C Builder" Better execution efficiency and use keyword message to assign window messages ... ", here the keyword should be changed to reserved words, because Message is a reserved word rather than a keyword. We are also reading the source code of VCL Often you can see the name of the mexage as a variable.