fdoc

functionend_of_linepureprivate

pure integer function end_of_line(text, from) result(at)

The position of the end of the line with position from: of its newline, or after the last line.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

fromintegerin

a position

Result

NameTypeAttributesDescription
atinteger

Source

Show the code
pure integer function end_of_line(text, from) result(at)
    character(len=*), intent(in) :: text    !! the text
    integer, intent(in) :: from             !! a position
    integer :: found

    found = index(text(from:), NL)
    at = merge(from + found - 1, len(text) + 1, found > 0)
end function end_of_line

Graphs

Called by