comp.lang.ada
 help / color / mirror / Atom feed
  • * Re: how do i include 111111 in an enumaration type ?
           [not found] ` <38021792_4@news1.prserv.net>
           [not found]   ` <slrn80495c.2a2.aidan@skinner.demon.co.uk>
    @ 1999-10-12  0:00   ` Sybs ALHABSHI
      1999-10-12  0:00     ` Lutz Donnerhacke
      1999-10-12  0:00     ` Matthew Heaney
      1 sibling, 2 replies; 14+ messages in thread
    From: Sybs ALHABSHI @ 1999-10-12  0:00 UTC (permalink / raw)
    
    
    Thanks for the hint. Yet I'll risk asking a ridiculous beginner's question :
    Can't I have ..sort of an array of strings  ?
    
    Sybs
    
    
    
    
    
    
    
    ^ permalink raw reply	[flat|nested] 14+ messages in thread
  • * Re: how do i include 111111 in an enumaration type ?
           [not found] <7tsq3o$92p$1@minus.oleane.net>
           [not found] ` <38021792_4@news1.prserv.net>
    @ 1999-10-12  0:00 ` Nick Roberts
      1999-10-14  0:00   ` Sybs ALHABSHI
      1 sibling, 1 reply; 14+ messages in thread
    From: Nick Roberts @ 1999-10-12  0:00 UTC (permalink / raw)
      To: Sybs ALHABSHI
    
    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,"<BODY");
          Put(Web_File," bgcolor=#");
          Put(Web_File,Hex_Image(Background_Color));
          Put(Web_File," text=#");
          Put(Web_File,Hex_Image(Text_Color));
          ...
    
    Hope this gives you a few ideas.
    
    -- 
    Nick Roberts
    Computer Consultant (UK)
    http://www.callnetuk.com/home/nickroberts
    http://www.adapower.com/lab/adaos
    
    
    
    
    ^ permalink raw reply	[flat|nested] 14+ messages in thread

  • end of thread, other threads:[~1999-10-14  0:00 UTC | newest]
    
    Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <7tsq3o$92p$1@minus.oleane.net>
         [not found] ` <38021792_4@news1.prserv.net>
         [not found]   ` <slrn80495c.2a2.aidan@skinner.demon.co.uk>
    1999-10-11  0:00     ` how do i include 111111 in an enumaration type ? Keith Thompson
    1999-10-12  0:00   ` Sybs ALHABSHI
    1999-10-12  0:00     ` Lutz Donnerhacke
    1999-10-12  0:00       ` Matthew Heaney
    1999-10-12  0:00         ` Lutz Donnerhacke
    1999-10-12  0:00           ` Ted Dennison
    1999-10-13  0:00             ` Lutz Donnerhacke
    1999-10-13  0:00               ` Matthew Heaney
    1999-10-13  0:00                 ` Ted Dennison
    1999-10-12  0:00           ` Ted Dennison
    1999-10-12  0:00     ` Matthew Heaney
    1999-10-12  0:00       ` Ehud Lamm
    1999-10-12  0:00 ` Nick Roberts
    1999-10-14  0:00   ` Sybs ALHABSHI
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox