[fpc-pascal] BoolToStr

Marco van de Voort fpc at pascalprogramming.org
Sun Aug 28 21:22:21 CEST 2022


Op 8/28/2022 om 8:45 PM schreef Ralf Quint via fpc-pascal:
> On 8/28/2022 8:23 AM, James Richters via fpc-pascal wrote:
>> Running "i:\booltostr.exe "
>>
>> -1
>>
>> 0
>>
>> Why true is -1 instead of 1 is beyond me, but anyway, I would 
>> consider this BoolToInt, not BoolToStr,I want the Strings ‘TRUE’ or 
>> ‘FALSE’ as indicated in the documentation
>>
> Very logical in fact. 0 is NO bit set in any given size of boolean 
> data type, -1 means ALL bits set on that same size boolean data type.
>
Pascal boolean datatypes only have 0 or 1 as defined values.  But 
probably it is for some COM or Winapi compatible purpose.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20220828/550fa11a/attachment-0001.htm>


More information about the fpc-pascal mailing list