2011/11/28 Santiago A. :
[...]
> By the way, I don't have a delphi near to check it. Is tryStrTofloat a fpc
> function or it is also a delphi function? If there is such function in
> delphi, someone gave up searching help too soon.
After F1 on Delphi:
=
Delphi Object and Component Re
El vie, 25-11-2011 a las 14:34 +0100, Bart escribió:
> On 11/25/11, Santiago A. mailto:s...@ciberpiula.net>>
> wrote:
> > El 25/11/2011 10:16, Kjow escribió:
> >
> > What about the standard pascal function "val"
> >
>
> Doesn't Val() use a hardcoded period (.) as decimalseparator?
> The StrToFloa
On 11/25/11, Santiago A. wrote:
> El 25/11/2011 10:16, Kjow escribió:
>
> What about the standard pascal function "val"
>
Doesn't Val() use a hardcoded period (.) as decimalseparator?
The StrToFloat() family uses (Default)FormatSettings AFAIK.
Bart
--
__
var
S: string;
F: Double;
R: Boolean;
begin
S := 'A';
R := TryStrToFloat(S, F);
end;
--
Silvio Clécio
===
Blog -
Twitter -
Facebook -
LazSolutions -
Lazarus-BR -
===
* Conheça nosso canal IRC
El 25/11/2011 10:16, Kjow escribió:
What about the standard pascal function "val"
function IsStrFloatNum(s: string): Boolean;
var
dummyNumber:double;
posError:integer;
begin
val(s, dummyNumber, posError);
result:=(posError=0);
end;
Time ago I came across a program written by someone that ha
2011/11/25 Michael Van Canneyt :
>
> You should use the default TryStrToFloat() function from the sysutils unit.
> It does exactly that, without exceptions.
>
> The function result may change if the internationalization/localization
> settings have changed. e.g. if you switch from platform.
>
> Sec
You should use the default TryStrToFloat() function from the sysutils unit.
It does exactly that, without exceptions.
The function result may change if the internationalization/localization
settings have changed. e.g. if you switch from platform.
Secondly, please note that in the debugger y
Am 25.11.2011 10:16, schrieb Kjow:
Debugger Exception Notification
project.exe raised exception class 'EConvertError' with message:
"Cross" is an invalid float
This happens only if you run it in Lazarus. In this notification window
should be a checkbox for ignoring this exception type while de
Hi all,
I need to know if a string is a valid floating-point number, so I
tried this function:
function IsStrFloatNum(s: string): Boolean;
begin
try
// try to convert the string into a floatnumber
StrToFloat(s);
// if there is no error the result is true
Result := True;
except