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,c204c2633e999a33 X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: Rep Clause Vaues?? Date: 1997/01/22 Message-ID: #1/1 X-Deja-AN: 211435227 sender: tardieu@esmeralda.enst.fr references: <5c3oh5$7oh@uuneo.neosoft.com> mail-copies-to: sam@ada.eu.org to: rlove@neosoft.com (Robert B. Love ) content-type: text/plain; charset=iso-8859-1 organization: TELECOM Paris mime-version: 1.0 newsgroups: comp.lang.ada Date: 1997-01-22T00:00:00+00:00 List-Id: >>>>> "Robert" == Robert B Love writes: Robert> What method can I use to get back the bit pattern or integer Robert> value represented by the enumerated type? All my attempts at Robert> type conversion and pos/val attributes have failed. Wanna be dirty? :) The untested piece of code below should do the job using the Get_Value function: ### type Int_Mechs is mod 2 ** Mechs'Size; for Int_Mechs'Size use Mechs'Size; function Get_Value is new Ada.Unchecked_Conversion (Mechs, Int_Mechs); ### Sam -- Samuel Tardieu -- sam@ada.eu.org