Append text and track the output column.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(writer_t), | intent(inout) | :: | w |
the output and the alignment state |
||
| character(len=*), | intent(in) | :: | text |
text to append; it may contain line breaks |
subroutine put(w, text) !! Append `text` and track the output column. type(writer_t), intent(inout) :: w !! the output and the alignment state character(len=*), intent(in) :: text !! text to append; it may contain line breaks integer :: j call w%buf%append(text) j = scan(text, achar(10)//achar(13), back=.true.) if (j > 0) then w%col = utf8_width(text(j + 1:)) else w%col = w%col + utf8_width(text) end if end subroutine put