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,FREEMAIL_FROM, 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: johnherro@aol.com (John Herro) Subject: Re: String to Integer Date: 1997/07/15 Message-ID: <19970715204901.QAA01858@ladder01.news.aol.com>#1/1 X-Deja-AN: 257056822 References: <5qglt7$cba$1@news.fsu.edu> X-Admin: news@aol.com Organization: AOL http://www.aol.com Newsgroups: comp.lang.ada Date: 1997-07-15T00:00:00+00:00 List-Id: hill@cs.fsu.edu (Charles Hill) writes: > I have a string in which an integer is stored. > I'd like 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... Not into an Ada *package*, but built into the language itself. If S is the string and I is an Integer variable, you can write I := Integer'Value(S); The 'Value is called an attribute. The 'Image attribute goes the other way, so you could also write S := Integer'Image(I); 'Image and 'Value work with many types, not just Integer, but they always convert to and from strings. For more information, you can download the Ada Tutor program from the Web or FTP sites below my signature. I hope this helps. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor