[fpc-pascal] BoolToStr

Jean SUZINEAU jean.suzineau at wanadoo.fr
Mon Aug 29 10:33:11 CEST 2022


Le 29/08/2022 à 01:41, James Richters via fpc-pascal a écrit :
> If a special function is needed for some COM thing or weird Winapi thing, then that function should be part of the unit that needs it, not modifying the generic function intended to be used for general purpose applications output something that does not conform to other Pascal Boolean datatypes and just confuses everyone.
Unfortunately, it's not just a few windows functions which use this 
behaviour but the whole Windows API:

https://docs.microsoft.com/fr-fr/windows/win32/api/winuser/nf-winuser-getmessage?redirectedfrom=MSDN

The Microsoft BOOL datatype uses this convention so the whole ecosystem 
is attracted to use it (other C program on windows, Delphi, ... )

I imagine it's more efficient at the assembler level to process the 
result of functions returning boolean.



More information about the fpc-pascal mailing list