[AWS] AWS.Utils.Is_Number not working ?
Pascal Obry
p.obry@wanadoo.fr
Thu, 2 Oct 2003 18:06:18 +0200
Arnaud,
> ----------
> with Ada.Text_IO;
>
> with AWS.Utils;
>
> procedure Ledger_Create is
> begin
> Ada.Text_IO.Put_Line (Boolean'Image(AWS.Utils.Is_Number("5001")));
> end Ledger_Create;
> ----------
> On the execution, it always returns FALSE!!!!
>
> What's wrong ? Do I need to rewrite AWS.Utils.Is_Number ??????
Quite strange. Using AWS 1.4w (but Is_Number has not changed since 1.3) I
have the right answer.
I'm using GNAT 3.16a1, can somebody with 3.15p at hand confirm that this
really answer false.
BTW, on which OS ?
What options did you use to compiler AWS (debug mode) ?
Just to be sure you have the right sources, here is the Is_Number
implementation:
function Is_Number (S : in String) return Boolean is
use Strings.Maps;
begin
return S'Length > 0
and then Is_Subset (To_Set (S), Constants.Decimal_Digit_Set);
end Is_Number;
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595