From: keith@telesoft.UUCP (Keith Shillington @prodigal)
Subject: Ada type question
Date: 6 Jan 89 15:09:53 GMT [thread overview]
Message-ID: <8901061625.AA00522@ucsd.edu> (raw)
-- To define an array type:
type x is array(integer range 1..10) of character;
-- Would define a ten element array of characters. "Better" Ada would be:
subtype x_range is integer range 1..10;
type x is array(x_range) of character;
-- More flexible would be:
type x is array(integer range <>) of character;
subtype working_x_range is integer range 1..10;
subtype large_x_range is integer range 0..1000;
subtype working_x is x(working_x_range);
subtype large_x is x(large_x_range);
-- Then you can define your index variables of an appropriate type to work
-- with the objects that you define of the various x subtypes.
-- Keith Shillington, Education Group, TeleSoft
next reply other threads:[~1989-01-06 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-01-06 15:09 Keith Shillington @prodigal [this message]
1989-01-07 16:28 ` Ada type question Mike Packer,318K,,2928607
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox