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,cebf5cf473e617ff X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: Naive question Date: 1998/08/23 Message-ID: <1998082312065701.IAA26581@ladder01.news.aol.com>#1/1 X-Deja-AN: 383871629 References: <35DF1997.3CB29CD6@tech.swh.lv> X-Admin: news@aol.com Organization: AOL http://www.aol.com Newsgroups: comp.lang.ada Date: 1998-08-23T00:00:00+00:00 List-Id: Maxim Senin points out that i : Integer := Integer'Value ("m"); raises Constraint_Error. Right. Instead, use I : Integer := Character'Pos('m'); Note the single tic marks around the m. Since 'm' is of type Character, Character'Pos converts from Character to an integer type. To go the other way, Character'Val(109) converts from an integer type to Character. The attribute 'Value converts from type *String*, and 'Image converts *to* String. Thus Integer'Value("123") is 123, and Integer'Image(123) is " 123". HTH. - John Herro You can download a shareware Ada Tutor program at http://members.aol.com/AdaTutor