Re: [fpc-pascal] Possible bug in Numeric test

2016-02-27 Thread steveg
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

Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Bart
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

2016-02-24 Thread Vojtěch Čihák
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

Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Nitorami
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

Re: [fpc-pascal] Possible bug in Numeric test

2016-02-24 Thread Vojtěch Čihák
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

[fpc-pascal] Possible bug in Numeric test

2016-02-23 Thread steveg
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