Write lines (records) to a connected-formatted unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | unit | Logical unit. |
||
| type(string), | intent(in) | :: | lines(1:) | The lines. |
||
| character(len=*), | intent(in), | optional | :: | form | Format of unit. |
|
| integer, | intent(out), | optional | :: | iostat | IO status code. |
|
| character(len=*), | intent(inout), | optional | :: | iomsg | IO status message. |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine write_lines(unit, lines, form, iostat, iomsg)
!---------------------------------------------------------------------------------------------------------------------------------
!< Write lines (records) to a connected-formatted unit.
!---------------------------------------------------------------------------------------------------------------------------------
integer, intent(in) :: unit !< Logical unit.
type(string), intent(in) :: lines(1:) !< The lines.
character(len=*), intent(in), optional :: form !< Format of unit.
integer, intent(out), optional :: iostat !< IO status code.
character(len=*), intent(inout), optional :: iomsg !< IO status message.
integer :: l !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
do l=1, size(lines, dim=1)
call lines(l)%write_line(unit=unit, form=form, iostat=iostat, iomsg=iomsg)
enddo
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine write_lines