dos_compilers/Artek Ada v125/SAMPLE5.ADA
2024-07-08 09:31:49 -07:00

25 lines
578 B
Ada
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- SAMPLE5.ADA Array and record aggregates
procedure SAMPLE5 is
CONST : constant STRING (1..10) := "1234567890";
type TEMP_TYPE is
record
FIELD1 : INTEGER;
FIELD2 : CHARACTER;
FIELD3 : STRING (1..10) := ('H', 'e', 'l', 'l', 'o', others => ' ');
end record;
type TABLE is array (1..10) of INTEGER;
TEMP : TEMP_TYPE;
TEMP_STR : TABLE := (2 | 4 | 10 => 1, others => 0);
-- TEMP_STR now contains 0 1 0 1 0 0 0 0 0 1
begin
TEMP := (FIELD1 => 35, FIELD2 => 'Y', FIELD3 => CONST);
end SAMPLE5;