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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec207d04b64c2261 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-06 10:14:09 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.7.128.161!renate.komtel.net!blackbush.xlink.net!news.erfurt.thur.de!eastside.erfurt.thur.de!drcomp.erfurt.thur.de!not-for-mail From: Adrian Knoth Newsgroups: comp.lang.ada Subject: Re: Convert ASCII numerals to Integer numbers Date: 6 Aug 2001 16:09:11 GMT Organization: Modern Electronics Message-ID: <9kmff7$asb$1@drcomp.erfurt.thur.de> References: NNTP-Posting-Host: drcomp.erfurt.thur.de X-Server-Date: 6 Aug 2001 16:09:11 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.4.7 (i586)) Xref: archiver1.google.com comp.lang.ada:11399 Date: 2001-08-06T16:09:11+00:00 List-Id: Stewart wrote: > I am creating a menu and I am grabbing the terminal input using > get_line, but on this particular command the last 1 .. 3 characters > can be numerals in the range of 1 .. 999. > I am considering character'pos but how can I manipulate to an integer? Generally, you can use the string index: procedure karl is input : string(1..6); i,j : integer; begin get_line(input,j); i := Integer'Value(input(j-2..j) ); put(i); end karl; Of course, you should replace this by dynamic handling, i.e. unbounded strings combined with input'last-2 .. input'last. -- mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver Microsoft - Is that a kind of toilet paper?