subroutinetakepure
pure subroutine take(b, text)
Move the text of b to text.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| b | type(buffer_t) | inout | the buffer | |
| text | character(len=:) | out | allocatable | 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