console_t Derived Type

type, public :: console_t

Console object


Components

Type Visibility Attributes Name Initial
integer, public :: n_line = 1

Number of lines printed


Type-Bound Procedures

procedure, public :: update_line => console_update_line

Update a previously-written console line

  • private subroutine console_update_line(console, line_no, str)

    Overwrite a previously-written line in standard output

    Arguments

    Type IntentOptional Attributes Name
    class(console_t), intent(in) :: console

    Console object

    integer, intent(in) :: line_no

    Integer output from [[console_write_line]]

    character(len=*), intent(in) :: str

    New string to overwrite line

procedure, public :: write_line => console_write_line

Write a single line to the console

  • private subroutine console_write_line(console, str, line, advance)

    Write a single line to the standard output

    Arguments

    Type IntentOptional Attributes Name
    class(console_t), intent(inout) :: console

    Console object

    character(len=*), intent(in) :: str

    String to write

    integer, intent(out), optional :: line

    Integer needed to later update console line

    logical, intent(in), optional :: advance

    Advancing output (print newline?)

Source Code

type console_t
    !> Number of lines printed
    integer :: n_line = 1

contains
    !> Write a single line to the console
    procedure :: write_line => console_write_line
    !> Update a previously-written console line
    procedure :: update_line => console_update_line
end type console_t