[fpc-pascal] Windows Type LPARAM, WPARAM

Urbansound urbansound at sbcglobal.net
Wed Aug 17 03:27:03 CEST 2005


I've been working with FPC 2.0.0 and Dev-Pas for some GUI efforts and anoth=
er programmer pointed out an interesting thing, regarding the LPARAM and WP=
ARAM types.  I hope I'm not kicking up old dust, but for the sake of clarif=
ication 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 perspec=
tieve, where in Pascal, case is insensitive.   In Dev-Pas' gui template, th=
ey 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 va=
riables 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 comp=
iler design...  Is there any way to switch on case sensitivity or otherwise=
 a switch to have references become reserved words, such that their case in=
sensitive nature can be raised as an error in the above cases?  LPARAM AND =
WPARAM are consistently present in most windows usage.

i.e.     LParam: Longint     >    would raise an error for reserved word.
         LParam:LPARAM    >    would raise an error as a redundant cast

        xxx:Lparm would cast xxx to any case manner of Lparam/Wparam

I suppose that there are a number of cased words in Windows that make the c=
onsideration impractical overall,  but is this strictly a manner of managme=
nt on the programmers behalf, to watch declarations and scope closely, or c=
ould it ever be managed as a switched option?

Thanks in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freepascal.org/lists/fpc-pascal/attachments/20050817/8170=

More information about the fpc-pascal mailing list