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,bc7fae210b5e1392 X-Google-Attributes: gid103376,public From: Nick Roberts Subject: Re: how do i include 111111 in an enumaration type ? Date: 1999/10/12 Message-ID: <3802C50A.A5565DDA@callnetuk.com>#1/1 X-Deja-AN: 535684417 Content-Transfer-Encoding: 7bit References: <7tsq3o$92p$1@minus.oleane.net> X-Original-NNTP-Posting-Host: da129d153.dialup.callnetuk.com To: Sybs ALHABSHI X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 12 Oct 1999 06:12:47 GMT, da129d153.dialup.callnetuk.com Organization: Computer Consultant MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-10-12T00:00:00+00:00 List-Id: Sybs ALHABSHI wrote: > In the enumaration type declaration, the string of caracters 000000 is taken > as a numerical expression. > > Can anyone explain how I can get around this ? > > type webcolor is (FFFFFF, 000000); Sybs, I wonder if an enumeration type is what you are looking for here? Take a look at the following snippet of code. type Monochromatic_Level is mod 256; -- i.e. a byte type RGB_Color is record Red, Green, Blue: Monochromatic_Level; end record; Absolute_Black: constant RGB_Color := (16#00#, 16#00#, 16#00#); Absolute_White: constant RGB_Color := (16#FF#, 16#FF#, 16#FF#); function Hex_Image (Level: Monochromatic_Level) return String is Digit: constant array (Monochromatic_Level range 0..15) := ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); begin return Digit(Level/16) & Digit(Level mod 16); end; function Hex_Image (RGB: RGB_Color) return String is begin return Hex_Image(RGB.Red) & Hex_Image(RGB.Green) & Hex_Image(RGB.Blue); end; ... Put(Web_File,"