comp.lang.ada
 help / color / mirror / Atom feed
From: Cedric <Cedric.Lannock@gmx.net>
Subject: Help on record to a Newbie
Date: Thu, 27 Dec 2012 11:31:19 -0800 (PST)
Date: 2012-12-27T11:31:19-08:00	[thread overview]
Message-ID: <e0c99332-4f90-4d84-bc54-43d0fb7f5754@googlegroups.com> (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




             reply	other threads:[~2012-12-27 19:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27 19:31 Cedric [this message]
2012-12-27 19:50 ` Help on record to a Newbie 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
replies disabled

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