Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(array_list), | intent(in) | :: | this | |||
integer, | intent(in) | :: | start_element | The index of the first element in the slice to be returned |
||
integer, | intent(in) | :: | end_element | The index of the last element in the slice to be returned |
An array_list containing the elements within the slice.
Returns an array_list instance containing all items in this list within the specified slice, inclusive. Crashes if one of the indices is outside of the list's bounds.
function array_list_slice(this, start_element, end_element)
!* Author: Chris MacMackin
! Date: March 2016
!
! Returns an [[array_list]] instance containing all items in this
! list within the specified slice, inclusive. Crashes if one of
! the indices is outside of the list's bounds.
!
class(array_list), intent(in) :: this
integer, intent(in) :: start_element
!! The index of the first element in the slice to be returned
integer, intent(in) :: end_element
!! The index of the last element in the slice to be returned
class(list), allocatable :: array_list_slice
!! An array_list containing the elements within the slice.
end function array_list_slice