SetDisplayProfile
This routine sets the display settings.
Interface
- ܀ Interface
- ️܀ See example
- ↢
SUBROUTINE setDisplayProfile(DispProfile, advance, digmax, &
& matsep, orient, sep, style, unit, zeroas)
TYPE(DISP_SETTINGS), INTENT(IN) :: DispProfile
CHARACTER(*), OPTIONAL, INTENT(IN) :: advance
INTEGER(I4B), OPTIONAL, INTENT(IN) :: digmax
CHARACTER(*), OPTIONAL, INTENT(IN) :: matsep
CHARACTER(*), OPTIONAL, INTENT(IN) :: orient
CHARACTER(*), OPTIONAL, INTENT(IN) :: sep
CHARACTER(*), OPTIONAL, INTENT(IN) :: style
INTEGER(I4B), OPTIONAL, INTENT(IN) :: unit
CHARACTER(*), OPTIONAL, INTENT(IN) :: zeroas
END SUBROUTINE setDisplayProfile
This example shows the use of SetDisplayProfile method.
program main
use easifemBase
implicit none
REAL( DFP ) :: Amat(4,4)
CALL RANDOM_NUMBER(Amat)
CALL Display(Amat, "Default display, Amat=")
CALL SetDisplayProfile(DisplayProfileTerminal)
CALL Display(Amat, "DisplayProfileTerminal, Amat=")
CALL BlankLines(nol=2)
CALL SetDisplayProfile( &
& DispProfile=DisplayProfileTerminal, &
& style="LEFT")
CALL Display(Amat, "style=LEFT, Amat=")
CALL BlankLines(nol=2)
CALL SetDisplayProfile( &
& DispProfile=DisplayProfileTerminal, &
& style="ABOVE")
CALL Display(Amat, "style=Above, Amat=")
CALL BlankLines(nol=2)
CALL SetDisplayProfile( &
& DispProfile=DisplayProfileTerminal, &
& style="PAD")
CALL Display(Amat, "style=PAD, Amat=")
CALL BlankLines(nol=2)
CALL SetDisplayProfile( &
& DispProfile=DisplayProfileTerminal, &
& style="UNDERLINE")
CALL Display(Amat, "style=UNDERLINE, Amat=")
end program main
results
Default display, Amat=
--------------------------------------
0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
DisplayProfileTerminal, Amat=
--------------------------------------
0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
style=LEFT, Amat=0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
style=Above, Amat=
0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
-----------style=PAD, Amat=-----------
0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
style=UNDERLINE, Amat=
--------------------------------------
0.473240 0.794931 0.302510 0.015565
0.616153 0.537996 0.672348 0.040016
0.814727 0.157292 0.483702 0.836481
0.405293 0.527994 0.218889 0.681952
DispProfile
DispProfile is an instance of DISP_SETTINGS. You can pass following predefined global variables for DispProfile
:
- DisplayProfileTerminal
- DisplayProfilePrint
DisplayProfileTerminal
- advance="YES"
- matsep=","
- orient="COL"
- style="UNDERLINE"
- trim="FALSE"
- ZEROAS="."
DisplayProfilePrint
- advance="YES"
- matsep=","
- orient="COL"
- style="UNDERLINE"
- trim="FALSE"
- ZEROAS=""
advance
It can take following values:
- "YES", go to the next line.
- "NO", stay on the same line.
digmax
Number of significant digits to show.
matsep
Character used for separating the elements of matrix.
orient
- "ROW", display a vector as row.
- "COL", display a vector as column.
sep
String used to separate matrix columns.
style
- "LEFT", title is immediately to the left of the first line of the displayed item.
- "ABOVE", title is centred immediately above the item
- "PAD", title is centred above the item, padded with hyphens (-).
- "UNDERLINE", title is centred above the item, underlined with hyphens.
- "NUMBER", each matrix or vector row and / or column is numbered.
note
Any of the four title position styles can also be combined with the number style by specifying for example STYLE = 'PAD & NUMBER'.
info
Any character except space may be used instead of hyphen by prefixing it to the style. STYLE = '*underline' will thus underline the title with asterisks.
unit
Unit number of external file.
zeroas
String to display instead of zeros.