comp.lang.ada
 help / color / mirror / Atom feed
* ??? Help!: how to do unconstraned arrays/records???
@ 1998-11-04  0:00 al johnston
  1998-11-04  0:00 ` Albert S. Johnston
  1998-11-05  0:00 ` Tucker Taft
  0 siblings, 2 replies; 16+ messages in thread
From: al johnston @ 1998-11-04  0:00 UTC (permalink / raw)


HELP!!!!

I a trying to convert the following "static" ada data
structure to a structure that can be created dynamically,
ie via the "new" ada function, and setting the two
constrants at that time.

I can not seem to find anything that will work (as
far as type declarations) short of
moving the second level array (Host_array) into
the top level structure (system_config_type) and
making it 2d.  That is TOO ugly!!!!

Can one of you ada guru's help me out?
the current type definitions (ie the "static"
version) are below....

thanks!!!!

      -al
-------------------------------------------------------------

NUMBER_OF_HOST_WIDGETS : Integer := some bound;
NUMBER_OF_NODE_WIDGETS : Integer := some other bound;


 type Host_Config_Typ is
    record
      ID        : Integer;
      Label     : String;
    end record;

  type Host_Array is array (natural range <>) of Host_Config_Typ;

  type Node_Config_Typ is
    record
      ID              : integer;
      Label           : String;
      Number_of_hosts : Natural := 0;
      Hosts           : Host_Array(1..NUMBER_OF_HOSTS_WIDGETS);
    end record;

  type Node_Array is array (natural rangee <>) of Node_Config_Typ;

  type System_Config_Typ is
    record
      Number_of_nodes :  Natural := 0;
      Nodes : Node_Array(NUMBER_OF_NODE_WIDGETS);
    end record;

  Config                : System_Config_Typ;






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

end of thread, other threads:[~1998-11-06  0:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-04  0:00 ??? Help!: how to do unconstraned arrays/records??? al johnston
1998-11-04  0:00 ` Albert S. Johnston
1998-11-05  0:00   ` dewarr
1998-11-05  0:00     ` al johnston
1998-11-05  0:00       ` dewar
1998-11-05  0:00       ` Stephen Leake
1998-11-05  0:00 ` Tucker Taft
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` al johnston
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` Mats Weber
1998-11-05  0:00       ` Tucker Taft
1998-11-05  0:00         ` al johnston
1998-11-05  0:00           ` Tucker Taft
1998-11-06  0:00             ` Mats Weber
1998-11-06  0:00               ` Tucker Taft

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