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,fd8c808621763c34 X-Google-Attributes: gid103376,public From: Steve Kerr Subject: Re: help Please Date: 1999/01/26 Message-ID: <36ADB3F7.7A239560@gecm.com>#1/1 X-Deja-AN: 437084062 Content-Transfer-Encoding: 7bit References: <36ab9be5.2873369@news.ptd.net> Content-Type: text/plain; charset=us-ascii Organization: GMRDS Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-01-26T00:00:00+00:00 List-Id: Matthew Heaney wrote: [....snip snip.....] > If you want to add two characters together, then just define an operator > to do that: > > function "+" (L, R : Character) return Character is ...; > > You can't "typecast" a character to integer, like this > > ... Integer (C) ... > > but of course you can convert a character into its underlying integer > representation either by using Unchecked_Conversion or Character'Pos. > More simply, you can use the value attribute. For example integer'value("4") will give you the integer value 4, not the code for ASCII "4". This attribute can be used with any string representing a discrete type, so I guess boolean'value("TRUE") works too (although I have only ever tried it with numeric values). Leading and trailing spaces in the string are ignored, so there's no need to trim it. As a matter of interest, this 'value is the opposite of 'image. BTW Jarrod, if the computer does not know how to add, what does it do with the '+' operator in your example ;-)