Re: [fpc-pascal] QWord/UInt64 and Range Check Errors

2009-06-26 Thread Marco van de Voort
In our previous episode, m2 said: instead, it is not possible (without violating the spirit of the Pascal language The fact that Borland regarded $FF..FF as a 2's complement representation and not as a base-16 representation of an integer is not really what I would call Pascal spirit. As

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

2009-06-26 Thread Graeme Geldenhuys
Hi, I'm busy translating our projects. fpGUI Toolkit uses it's own translation via .po files (similar to Lazarus projects). But now there are some output that is not being translated because it is output from the RTL. One such case is the output of BoolToStr(). How am I supposed to translate

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

2009-06-26 Thread Michael Van Canneyt
On Fri, 26 Jun 2009, Graeme Geldenhuys wrote: Hi, I'm busy translating our projects. fpGUI Toolkit uses it's own translation via .po files (similar to Lazarus projects). But now there are some output that is not being translated because it is output from the RTL. One such case is the output

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

2009-06-26 Thread Graeme Geldenhuys
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?

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

2009-06-26 Thread Michael Van Canneyt
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

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

2009-06-26 Thread Graeme Geldenhuys
Michael Van Canneyt wrote: StrToBool should use all elements ? In FPC 2.2.5 it does not. implementation = begin if UseBoolStrs Then begin CheckStrs; if B then Result:=TrueBoolStrs[0] else Result:=FalseBoolStrs[0]; end else If B

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

2009-06-26 Thread Graeme Geldenhuys
Michael Van Canneyt wrote: StrToBool should use all elements ? In FPC 2.3.x (latest trunk) in also doesn't. Looks indentical to 2.2.5 Regards, - Graeme - ___ fpGUI - a cross-platform GUI toolkit using Free Pascal

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

2009-06-26 Thread Vincent Snijders
Graeme Geldenhuys schreef: Michael Van Canneyt wrote: StrToBool should use all elements ? In FPC 2.2.5 it does not. implementation = begin if UseBoolStrs Then begin CheckStrs; if B then Result:=TrueBoolStrs[0] else

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

2009-06-26 Thread Graeme Geldenhuys
Vincent Snijders wrote: Please add the declaration, to make sure it is StrToBool I'm not that blind. :-) And the function in question in BoolToStr(). But now that you mention StrToBool(), that is even worse, it hard-codes the 'FALSE' and 'TRUE' and doesn't even use the arrays. How come

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

2009-06-26 Thread Vincent Snijders
Graeme Geldenhuys schreef: Vincent Snijders wrote: Please add the declaration, to make sure it is StrToBool I'm not that blind. :-) And the function in question in BoolToStr(). But now that you mention StrToBool(), that is even worse, it hard-codes I did not mention StrToBool first,

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

2009-06-26 Thread Henry Vermaak
2009/6/26 Graeme Geldenhuys grae...@opensoft.homeip.net: How come nobody ever noticed this? Does everybody only write English programs. :-) Because it's so simple/trivial that everyone rolls their own for user interfaces? I know I do. Henry ___

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

2009-06-26 Thread Henry Vermaak
2009/6/26 Vincent Snijders vsnijd...@vodafonevast.nl: Graeme Geldenhuys schreef: How come nobody ever noticed this? Does everybody only write English programs. :-) Because I always thought these function were not for users, but for systems, for example to store a boolean in a xml file or

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

2009-06-26 Thread Graeme Geldenhuys
Vincent Snijders wrote: I did not mention StrToBool first, Michael did, and you seemed to ignore that. Sorry, that one slipped by me unnoticed Regards, - Graeme - fpGUI - a cross-platform Free Pascal GUI toolkit

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

2009-06-26 Thread Graeme Geldenhuys
Vincent Snijders wrote: Because I always thought these function were not for users, but for systems, for example to store a boolean in a xml file or to create an Your example is a good one and I agree there, but I do think it's for users to. For example, the whole reason I noticed the

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

2009-06-26 Thread Graeme Geldenhuys
Henry Vermaak wrote: I think even for config/system files they are useless, since it's a lot more friendly to support yes/no, true/false and on/off, not just true/false. Maybe that was the idea behind the TrueBoolStrs array. Element 0 is true/false, element 1 maybe yes/no, element 3 maybe

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

2009-06-26 Thread John Coppens
On Fri, 26 Jun 2009 15:54:55 +0100 Henry Vermaak henry.verm...@gmail.com wrote: How come nobody ever noticed this? Does everybody only write English programs. :-) I _hate_ to think of the consequences of localization of those strings. Have we had enough of the . and , problem? I don't think

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

2009-06-26 Thread Giuliano Colla
Graeme Geldenhuys ha scritto: Again, nothing like this is hinted at in the documentation. I'll double check on Monday what the Kylix 3 help says regarding BoolToStr and StrToBool and localization and when it should actually be used. Kylix 3 help on TrueBoolStrs variable specifies: quote When