fdoc

subroutinetakepure

pure subroutine take(b, text)

Move the text of b to text.

Arguments

NameTypeIntentAttributesDescription
btype(buffer_t)inout

the buffer

textcharacter(len=:)outallocatable

its text

Source

Show the code
pure subroutine take(b, text)
    type(buffer_t), intent(inout) :: b                  !! the buffer
    character(len=:), allocatable, intent(out) :: text  !! its text

    if (allocated(b%s)) then
        text = b%s(1:b%n)
    else
        text = ''
    end if
    b%n = 0
end subroutine take

Graphs

Called by