[UP]


Manual Reference Pages  - msg (3)

NAME

msg(3f) - [M_debug] converts any standard scalar type to a string (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

function msg(g1,g2g3,g4,g5,g6,g7,g8,g9)

class(*),intent(in),optional :: g1,g2,g3,g4,g5,g6,g7,g8,g9 character(len=:),allocatable :: msg

DESCRIPTION

msg(3f) builds a string from up to nine scalar values. Since the routine uses internal WRITE statements to build the returned string it should not be used in a WRITE or PRINT statement, as Fortran does not yet support recursive I/O.

OPTIONS

g[1-9] optional value to print the value of after the message. May be of type INTEGER, LOGICAL, REAL, DOUBLEPRECISION, COMPLEX, or CHARACTER.

RETURNS

msg description to print

EXAMPLES

Sample program:

   program demo_msg
   use M_debug, only : msg
   implicit none
   character(len=:),allocatable :: pr

pr=msg(’HUGE(3f) integers’,huge(0),’and real’,huge(0.0),’and double’,huge(0.0d0)) write(*,’(a)’)pr pr=msg(’real :’,huge(0.0),0.0,12345.6789,tiny(0.0) ) write(*,’(a)’)pr pr=msg(’doubleprecision :’,huge(0.0d0),0.0d0,12345.6789d0,tiny(0.0d0) ) write(*,’(a)’)pr pr=msg(’complex :’,cmplx(huge(0.0),tiny(0.0)) ) write(*,’(a)’)pr

! although it will often work, using msg(3f) in an I/O statement is not recommended write(*,*)msg(’program will now stop’)

end program demo_msg

AUTHOR

John S. Urban

LICENSE

Public Domain


msg (3) November 13, 2019
Generated by manServer 1.08 from 6ea2faba-e100-4bfa-9a05-cbfe7b4c5085 using man macros.