comp.lang.ada
 help / color / mirror / Atom feed
From: Christoph Grein <christoph.grein@eurocopter.com>
Subject: Re: Converting Char to Enum
Date: Wed, 6 Mar 2002 07:23:14 +0100 (MET)
Date: 2002-03-06T07:23:14+01:00	[thread overview]
Message-ID: <mailman.1015395902.24403.comp.lang.ada@ada.eu.org> (raw)

> So if I want to output only the character without the quotes, I have
> to convert it to string?

No, you have to use the character operations of Text_IO (if your characters are 
of type Standard.Character. No conversion to Standard.String is necessary.

Note that you may write:
ote that you may write:

procedure My_Program is

  type My_Character is (something, 'A', 'a', 'B', 'b', anything);
  type My_String is array (Positive range <>) of My_Character;

  V: My_String := "AAbbbA" & something & "aBBB";

begin

  ...

end My_Program;

String literals like "AAbbbA" are available for all character types, a character 
type being a type with at least one character literal, a character literal being 
something like 'a'. Note that the apperance of something and anything above in 
the type definition does not prevent My_Character from being a character type, 
you only cannot put these literals into a string literal, you have to do it in 
the way above. These strings are however not compatible with Standard.String, so 
you cannot use Text_IO with them directly.



             reply	other threads:[~2002-03-06  6:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06  6:23 Christoph Grein [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-02 18:17 Converting Char to Enum Lars Noschinski
2002-03-03  1:15 ` sk
2002-03-03 16:43   ` Robert Dewar
2002-03-03 18:54     ` Lars Noschinski
2002-03-03 20:07       ` Larry Kilgallen
2002-03-03 20:21         ` Lars Noschinski
2002-03-03 22:46           ` Larry Kilgallen
2002-03-04  6:55           ` Jeffrey Carter
2002-03-03 20:13       ` tmoran
2002-03-03  6:30 ` tmoran
2002-03-04 11:01 ` sk
     [not found] ` <3C835426.DA864199@myob.com>
2002-03-04 12:48   ` David C. Hoos, Sr.
2002-03-04 16:36     ` Lars Noschinski
2002-03-04 23:17       ` David C. Hoos
2002-03-05 15:55         ` Lars Noschinski
2002-03-05 20:15           ` David C. Hoos
replies disabled

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