> > You can use
>
> BoolToStr(b,'TRUE','FALSE')
>
> That works great! Shouldn't that be the default and you can put in
> something else if you want it?
Latest trunk allows you this if you include new syshelpers unit:
True.ToString; // True
True.ToTrueFals
On Mon, 29 Aug 2022, James Richters via fpc-pascal wrote:
Thanks for the discussion everyone, it does shed some light on what's
going on. I agree it would be impossible to change it now, It was
actually a GREAT idea to make it customizable, and that serves my needs
just fine. I guess all th
Thanks for the discussion everyone, it does shed some light on what's going on.
I agree it would be impossible to change it now, It was actually a GREAT idea
to make it customizable, and that serves my needs just fine.
I guess all that's left is to update the documentation to show what it rea
On 8/29/22 11:33, Jean SUZINEAU via fpc-pascal wrote:
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 intende
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
s
On Sun, 28 Aug 2022, James Richters via fpc-pascal wrote:
I'm curious if there is a way to search the FPC version history of changes
for BoolToStr to see why it was changed, and see if there is a valid
reason not to change it back. it was obviously changed from the way the
documentations is
Am 29.08.2022 um 01:41 schrieb James Richters via fpc-pascal:
I'm curious if there is a way to search the FPC version history of changes for
BoolToStr to see why it was changed, and see if there is a valid reason not to
change it back. it was obviously changed from the way the documentations is
I don't see how it makes anything compatible at all.. because it's NOT a 0 or a
-1 integer value, it's a STRING of '0' or '-1' so you can't even evaluate the
negative bit.. because there isn't one, it's a string of - and 1. You would
have to do StrToInt(BoolToStr(MyVariable)) to be able to ev
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’ a
at some point I guess.
Thanks for the suggestion, it works for my needs.
James.
-Original Message-
From: fpc-pascal On Behalf Of
Michael Van Canneyt via fpc-pascal
Sent: Sunday, August 28, 2022 11:39 AM
To: ja...@productionautomation.net; FPC-Pascal users discussions
Cc: Michael Van Ca
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
On Sun, 28 Aug 2022, James Richters via fpc-pascal wrote:
I'm generating a report where I wish to display some Boolean values. I
thought I would try BoolToStr, as according to:
https://www.freepascal.org/docs-html/rtl/sysutils/booltostr.html it states:
Description
BoolToStr converts the boo
I'm generating a report where I wish to display some Boolean values. I
thought I would try BoolToStr, as according to:
https://www.freepascal.org/docs-html/rtl/sysutils/booltostr.html it states:
Description
BoolToStr converts the boolean B to one of the strings 'TRUE' or 'FALSE'
So it should d
On Fri, 26 Jun 2009, Giuliano Colla wrote:
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
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:
When using
On Fri, 26 Jun 2009 15:54:55 +0100
Henry Vermaak 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 we need another
caus
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 on/
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 trans
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
http://opensoft.homeip.n
2009/6/26 Vincent Snijders :
> 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 to create an adh
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 to create an
adhoc dynamic SQL query. You would not want
2009/6/26 Graeme Geldenhuys :
>
> 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
___
fpc-pascal maillist - fpc-
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, Michael
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 nobo
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
Result:=FalseBool
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
http://opensoft.homeip.
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
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
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(TrueBoolS
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 o
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 that
I just fixed booltostr in 2.1.1 to be D7 compat.
This is one of the stupidest Delphi changes I ever saw, but anyway,
compability is compability.
Booltostr now returns "-1" and "0", and only "True" and "False" if you pass
true to the 2nd parameter which is default false. You can influence the
o
32 matches
Mail list logo