From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,353ec4aa58e82326 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: String to Integer conversion? Date: 1998/07/31 Message-ID: #1/1 X-Deja-AN: 376583169 Sender: matt@mheaney.ni.net References: <6ndi5d$uj3@gcsin3.geccs.gecm.com> NNTP-Posting-Date: Thu, 30 Jul 1998 22:33:11 PDT Newsgroups: comp.lang.ada Date: 1998-07-31T00:00:00+00:00 List-Id: John McCabe writes: > Integer_IO provides versions of the Get and Put routines where the first > parameter is a string, so you need to instantiate Integer_IO for your > Integer Type ( or use Ada.Integer_Text_IO for the pre-defined type > Integer) then call the Get operation e.g. In Ada 95 you don't need to instantiate Integer_IO on type Integer. An instantiation of Integer_IO, called Ada.Integer_Text_IO, comes predefined as part of the standard library. Ditto for type Float; there's a predefined instantiation called Float_Text_IO. Q for language lawyers: why no predefined instantiation of Fixed_IO for type Duration? As an alternative solution to the problem of converting a string to an integer, you can use the attribute Integer'Value.