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

Graeme Geldenhuys graemeg at opensoft.homeip.net
Fri Jun 26 14:29:43 CEST 2009


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.


Regards,
  - Graeme -

_______________________________________________________
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/




More information about the fpc-pascal mailing list