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,c7932390dcbd43b7,start X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: I'm Stumped ... Date: 1997/04/27 Message-ID: #1/1 X-Deja-AN: 237767030 References: <33638FBE.715C@usa.net> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-04-27T00:00:00+00:00 List-Id: In article <33638FBE.715C@usa.net>, Ben Carter wrote: >Could anyone point me in the direction of where >I could find examples of code or at least explain >a method to convert a string into an integer? > >Is it possible to take a string with the value : > '123' >and turn it into the integer 123? The Value attribute is the opposite of the Image attribute: declare The_Value : constant Integer := Integer'Value ("123"); begin You can also instantiate package Ada.Text_IO.Integer_IO, which exports a subprogram Get to read a value from a string. declare The_Value : Integer; Last : Positive; begin Ada.Integer_Text_IO.Get (From => "123", Item => The_Value, Last => Last); -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271