FPC and it returns False
for string 'E1/E2/etc'.
V.
__
> Od: steveg
> Komu: "FPC-Pascal users discussions"
> Datum: 24.02.2016 00:57
> Předmět: [fpc-pascal] Possible bug in Numeric test
>
Not sure
On 2/24/16, steveg wrote:
> Not sure if this is considered a bug or not :)
Fully compatible with Delphi 7.
{$apptype console}
{$ifdef fpc}
{$mode objfpc}
{$h+}
{$codepage utf8}
{$endif}
{$R+}
uses
classes,sysutils;
function IsNum( const sSrc :string ) :boolean;
var
Code :integer;
Num
Re: [fpc-pascal] Possible bug in Numeric test
Steve probably means "when passed 'E1' or 'E2' etc."
Indeed IsNum ('E1') interprets it as zero and delivers TRUE.
--
View this message in context:
http://free-pascal-general.1045716.n5.nabble.com/Possible
Steve probably means "when passed 'E1' or 'E2' etc."
Indeed IsNum ('E1') interprets it as zero and delivers TRUE.
--
View this message in context:
http://free-pascal-general.1045716.n5.nabble.com/Possible-bug-in-Numeric-test-tp5724297p5724319.html
Sent from the Free Pascal - General mailing lis
I tried your function in FPC 3.0.0 in mode ObjFPC and it returns False for
string 'E1/E2/etc'.
V.
__
Od: steveg
Komu: "FPC-Pascal users discussions"
Datum: 24.02.2016 00:57
Předmět: [fpc-pascal] Possible bug i
Not sure if this is considered a bug or not :)
I have found this function returns TRUE if passed 'E1/E2/etc'
I am guessing it is seeing the 'E' as exponent
function IsNum( const sSrc :string ) :boolean;
var
Code :integer;
Num :real = 0;
begin
Num := Num;
Val(sSrc, Num, Code);
Exit( Co