[fpc-pascal] BoolToStr() with correct locale output

Michael Van Canneyt michael at freepascal.org
Fri Jun 26 15:21:44 CEST 2009

On Fri, 26 Jun 2009, Graeme Geldenhuys wrote:

> Michael Van Canneyt wrote:
>> So all you need to do is initialize them with the localized versions
>> prior to the first call of BoolToStr().
> Thanks Michael.  Now the other obvious question, why is TrueBoolStrs and
> FalseBoolStrs array types?  Why not simply of type String?
>  SetLength(TrueBoolStrs,1);
>  TrueBoolStrs[0] := 'Waar';
>  SetLength(FalseBoolStrs,1);
>  FalseBoolStrs[0] := 'Onwaar';
> Looking at the implementation of BoolToStr(), it only ever uses the
> first element. Reading the fpdoc help on BoolToStr and FalseBoolStrs it
> doesn't mention anything about why the are defined as arrays and what
> the other elements (if more than one) is used for.

StrToBool should use all elements ?


More information about the fpc-pascal mailing list