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,5c709276a96171f1 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: newbie question: String to Integer conversion Date: 1999/12/09 Message-ID: <82pkic$ani$1@holly.prod.itd.earthlink.net>#1/1 X-Deja-AN: 558814857 Content-Transfer-Encoding: 7bit References: X-Posted-Path-Was: not-for-mail Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-ELN-Date: 10 Dec 1999 01:21:16 GMT X-ELN-Insert-Date: Thu Dec 9 17:25:07 1999 Organization: Ada95 Press, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-09T00:00:00+00:00 List-Id: Noam Kloos wrote in message news:OsUkROpQ$GA.331@net003s... > Hello, > > I tried to make a program and it worked. However I also tried to use > Ada.Command_Line package. My argument must be an integer, but > Ada.Command_Line passes a String. I do not know how to convert a > string into an Integer. > > Tried to look through the adainclude directory but came up with > nothing. > > I am using an i386 redhat 6.0 gnat-3.12 ada compiler. > > My recusive program can be found as a zipfile at > www.bigfoot.com/~nkloos/ada.htm > > Greetings and hopefully Thanks for giving me the solution.. > For every scalar type T the attribute function T'Value (X : String) returns the value represented by X, if X represents a value of the type. Otherwise Constraint_Error is raised. So... Integer'Value ("1234") returns the integer 1234.