comp.lang.ada
 help / color / mirror / Atom feed
* Help on record to a Newbie
@ 2012-12-27 19:31 Cedric
  2012-12-27 19:50 ` Jeffrey Carter
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Cedric @ 2012-12-27 19:31 UTC (permalink / raw)


Hi All,

I started learning Ada (it's the third time I try!).

I defined and declared the following:

  type t_terminal_type is (black_n_white, black_n_yellow,
                           black_n_green, color);
  type t_color_type is (red, green, blue, yellow, black, white, grey);
  type t_configure_type is
    record
      terminal   : t_terminal_type;
      foreground,
      background : t_color_type;
    end record;

 t_config : t_configure_type;

  t_config.terminal   := black_n_white;
  t_config.background := black;
  t_config.foreground := white;

The compiler (GNAT 2012) comes back with "declaration expected" for the last three lines.

As far as I understood the language I have declared the variable "t_config". This variable has the components terminal, background and foreground of their respective types which can be accessed using dot-notation.

What did I miss here?

Kind regards

Cedric




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

end of thread, other threads:[~2012-12-30 17:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-27 19:31 Help on record to a Newbie Cedric
2012-12-27 19:50 ` Jeffrey Carter
2012-12-27 19:51 ` Niklas Holsti
2012-12-27 20:25 ` Shark8
2012-12-27 23:53 ` Cedric
2012-12-28  8:00   ` Niklas Holsti
2012-12-28  8:30     ` Cedric
2012-12-28  9:29       ` Simon Wright
2012-12-30 17:29       ` Niklas Holsti
2012-12-28 11:52 ` Cedric
2012-12-28 15:36   ` Shark8
2012-12-30 16:03   ` Niklas Holsti

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