stupid_search Function

public function stupid_search(list, val) result(pos)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: list(:)
integer, intent(in) :: val

Return Value integer


Contents

Source Code


Source Code

    function stupid_search(list, val) result(pos)
        integer, intent(in) :: list(:), val
        integer :: pos

        integer :: i

        pos = 0

        do i = lbound(list, 1), ubound(list, 1)
            if (val == list(i)) then
                pos = i
                return
            end if
        end do

    end function stupid_search