array_list_insert Subroutine

private subroutine array_list_insert(this, position, item)

Arguments

Type IntentOptional AttributesName
class(array_list), intent(inout) :: this
integer, intent(in) :: position

The location at which the new element will be placed

class(*), intent(in) :: item

The value to be placed in the list

Description

Places the provided item into the list at the position specified, moving all succeeding items forward by one. The position must be one which is already filled or the length of the list plus one.


Source Code

  subroutine array_list_insert(this, position, item)
    !* Author: Chris MacMackin
    !  Date: March 2016
    !
    ! Places the provided item into the list at the position specified,
    ! moving all succeeding items forward by one. The position must be
    ! one which is already filled or the length of the list plus one.
    !
    class(array_list), intent(inout) :: this
    integer, intent(in) :: position
      !! The location at which the new element will be placed
    class(*), intent(in) :: item
      !! The value to be placed in the list
  end subroutine array_list_insert