[fpc-pascal] Windows Type LPARAM, WPARAM

Michael Van Canneyt michael at freepascal.org
Fri Sep 2 16:02:31 CEST 2005



On Tue, 16 Aug 2005, Urbansound wrote:

> Hi,
> 
> I've been working with FPC 2.0.0 and Dev-Pas for some GUI efforts and another programmer pointed out an interesting thing, regarding the LPARAM and WPARAM types.  I hope I'm not kicking up old dust, but for the sake of clarification if we may...
> 
> The Microsoft architecture affiliates these two keywords as "Types", based upon case sensitivity, among the variouse usage they apply from a C perspectieve, where in Pascal, case is insensitive.   In Dev-Pas' gui template, they assign these same words as follows... 
> 
> //--------- 
> function WindowProc(Window: HWnd; AMessage, WParam,
>           LParam: Longint): Longint; stdcall; export;
> 
> LParam becomes Longint, but it is a TYPE actually.
> 
> Without case sensitivity in Pascal, these same words can become declared variables as above, which leads to ambiguous code.
> 
> 
> //----------
> Consider the useage otherwise as ...
> 
> function WindowProc(Window: HWnd; AMessage: UINT; WParam : WPARAM;
>                     LParam: LPARAM): LRESULT; stdcall; export;
> 
> In hopes of avoiding a discussion on the merits of case-sensitivity in compiler design...  Is there any way to switch on case sensitivity or otherwise a switch to have references become reserved words, such that their case insensitive nature can be raised as an error in the above cases?  LPARAM AND WPARAM are consistently present in most windows usage.

Pascal is case insensitive, and that will not change any time soon, if ever.
99.99% of all code out there would stop working if it was made case sensitive.

Michael.



More information about the fpc-pascal mailing list