comp.lang.ada
 help / color / mirror / Atom feed
* subtype definitions
@ 2012-09-26 13:45 björn lundin
  2012-09-26 13:58 ` Niklas Holsti
  0 siblings, 1 reply; 3+ messages in thread
From: björn lundin @ 2012-09-26 13:45 UTC (permalink / raw)


Hi!

I got a type definition as

type Assignment_Type_Type is (Transport, Store, Retrieve, Rearrange, Check, 
                                Set_Error, Restore, Mob_Trsp1, Mob_Trsp2, 
                                Mob_Trsp3, Mob_Trsp4, Mob_Store, Mob_Check);

I want to loop through some of the values, in another order

for Asm_Type in Transport | Check | Restore | Set_Error | Store loop
  Do_Something(Asm_Type);
end loop;

The above does not compile.

subtype Asm_Type_Type is Assignment_Type_Type range  Transport | Check | Restore | Set_Error | Store ; 
no go . 

Is there a valid construction in Ada 05 (gnat) that I can use?

http://en.wikibooks.org/wiki/Ada_Programming/Subtypes
has a long discussion, but none with 
 elements in different order, only like Retrieve .. Check



--
Björn Lundin






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-26 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-26 13:45 subtype definitions björn lundin
2012-09-26 13:58 ` Niklas Holsti
2012-09-26 14:36   ` björn lundin

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