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,273f68be0dc28cef X-Google-Attributes: gid103376,public From: mcc@tyrolia.cs.princeton.edu (Martin C. Carlisle) Subject: Re: String to Integer Date: 1997/07/16 Message-ID: <5qijd3$8kj$1@cnn.Princeton.EDU>#1/1 X-Deja-AN: 257211062 References: <5qglt7$cba$1@news.fsu.edu> Organization: US Air Force Academy, Dept of Computer Science Newsgroups: comp.lang.ada Date: 1997-07-16T00:00:00+00:00 List-Id: In article <5qglt7$cba$1@news.fsu.edu>, Charles Hill wrote: >I have a string in which an integer is stored. I'd like to hear >from someone who might know a convenient way to convert this to >an actual integer. I'm wondering if there is a function built >into one of the Ada packages to do this, but I haven't found one >yet. Usually you can find any similar thing you might need in Ada.Text_IO In your case (e.g.): Ada.Integer_Text_IO.Get(From => My_String, Item => Integer_Value, Last => Last_Location_Read_From_String); There is also a shorter method using attributes: Integer_Value := Integer'Value(My_String); --Martin -- Martin C. Carlisle, Computer Science, US Air Force Academy mcc@cs.usafa.af.mil, http://www.usafa.af.mil/dfcs/bios/carlisle.html DISCLAIMER: This content in no way reflects the opinions, standard or policy of the US Air Force Academy or the United States Government.