comp.lang.ada
 help / color / mirror / Atom feed
* Different initial values for derived type?
@ 2003-11-09 14:10 Stefan Soos
  2003-11-10 12:56 ` Mark Doherty
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Soos @ 2003-11-09 14:10 UTC (permalink / raw)


Hello,

I've got the following type definition

     type Object_Type is tagged 
	  record
		Name  : Character := '?';
		Score : Natural   := 0;
		X	: Positive  := 1;
		Y     : Positive  := 1;
	  end record;
Now I'd like to have a derived type with the same components
but with different initial Values. Do I have to use discriminants for
all of my components or can I say something like

    type Derived_Type is new Object_Type with ( Name  => '!', 
					        Score => 10); 
I know, I can't because it doesn't compile, but is there a
similar approach?


Thanks in advance,
Stefan

-- 




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

end of thread, other threads:[~2003-11-10 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-09 14:10 Different initial values for derived type? Stefan Soos
2003-11-10 12:56 ` Mark Doherty

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