attr_mode(3f) - [M_framework__attr] select processing mode for output from attr(3f) (LICENSE:MIT)
Synopsis
Description
Options
Examples
Author
License
subroutine attr_mode(manner)
character(len=*),intent(in) :: manner
Turn off the generation of strings associated with the HTML keywords in the string generated by the attr(3f) function, or display the text in raw mode as it was passed to attr(3f) or return to ANSI escape control sequence generation.
MANNER The current manners or modes supported via the attr_mode(3f) procedure are
plain suppress the output associated with keywords color(default) commonly supported escape sequences raw echo the input to attr(3f) as its output reload restore original keyword meanings deleted or replaced by calls to attr_update(3f).
Sample program
program demo_attr_mode use M_framework__attr, only : attr, attr_mode implicit none character(len=:),allocatable :: lines(:) character(len=:),allocatable :: outlines(:) integer :: i lines=[character(len=110):: & &<M><y>,& &<M><y> Suffice it to say that black and white are also colors,& &<M><y> for their simultaneous contrast is as striking as that ,& &<M><y> of green and red, for instance. & & --- <y><bo>Vincent van Gogh</bo></y>,& & ]outlines=attr(lines,chars=57) write(*,(a))(trim(outlines(i)),i=1,size(outlines))
call attr_mode(manner=plain) ! write as plain text write(*,(a))attr(lines)
call attr_mode(manner=raw) ! write as-is write(*,(a))attr(lines)
call attr_mode(manner=ansi) ! return to default mode
end program demo_attr_mode
John S. Urban, 2021
Nemo Release 3.1 | attr_mode (3) | February 23, 2025 |