






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Operation Explanation Initialize Initialize the internal structure of the list, make sure it’s empty Empty Returns true iff the list is empty Insert Inserts a new element after the kth element; if k is zero, then insert at the beginning of the list Delete Delete the kth^ item in the list
a day
Marks 84 72 93 56 73 75 42 68
Marks(1) Marks(8)
about several different things
type of information can go into each box.
the array items
When designing an array, you need to decide what the
the array index may be INTEGER, CHARACTER or any
the array element type can be
Courtesy of Chris Lokan. Used with permission.
the array what
the type of the array index is not related to the type of
constant := 8; constant := 'a'; constant := 'h';
subtype STRING8 is STRING (1 .. 8); type int_8_array (1 .. max_iarr) of INTEGER; type float_arrays (min_farr..max_farr) of FLOAT; type str_arrays (-5 .. 2) of STRING8; type small_arrays ('a' .. 'c') of FLOAT;
The declaration gives a name to the array type then can declare variables of that array type (^) arr1 : int_8_array; arr2 : float_arrays; arr3 : str_arrays;
coord1 : small_arrays := (1.2, 2.4, 3.6) ;
coord2 : small_arrays := ('c'=>3.6, 'b'=>2.4, 'a'=>1.2) ;
type small_arrays ('a' .. 'c') of FLOAT;
max_iarr : min_farr : max_farr :
is array is array is array is array
is array
-- various constants used in data types -- largest index in int array -- low index in float array -- high index in float array -- type declarations
-- init array coord1 using a positional list
-- init array coord1 using explicit index references
-- init array coord1 using others
variable name.
specify the array variable name and the index value for the element you want.
PUT(coord1('b'));
total := coord1('a') + coord1('b') + coord1('c');
PUT(arr3(-2));
Attribute Meaning
‘ first The value of the smallest index ‘ last The value of the largest index ‘ range The entire range or index values ‘ length The number of items in the array
for the array "count", regardless of the index type and range.
another of the same type
another of the same type
end if
parameter to a procedure or function.
so depends on how the formal parameter was declared in the subprogram: unconstrained array type is used for the formal parameter, then any variable based on
parameter, then only variables of that type may
when the range of index values was specified
not specified in type declaration
variable declarations
be passed as an actual parameter
that type may be passed as an actual parameter.