Manual Reference Pages  - system_putchar (3m_system)

NAME

system_putchar(3f) - [M_system:IO] writes a character to the stdout stream. (LICENSE:PD)

CONTENTS

Synopsis
Description
Return Value
Examples

SYNOPSIS

integer(kind=c_int) function system_putchar(ch)

     character(len=1),intent(in) :: ch

DESCRIPTION

system_putchar(3f) writes the character CH to the stdout stream via C I/O by passing the character on to putchar(3c).

RETURN VALUE

A negative value is returned on error. Otherwise putchar(3f) returns a default integer with the ADE (ASCII Decimal Equivalent) of the character written.

EXAMPLES

Example program

       program demo_system_putchar
       use M_system,      only : system_putchar
       implicit none
       integer :: i, j
       integer :: iostat
       j=0
       do i=32,126 ! printable ASCII characters
          iostat=system_putchar(achar(i))
          if(iostat.lt.0)stop ’<ERROR> *main* character ’//achar(i)
          j=j+1
          if(j.ge.19)then
             iostat=system_putchar(new_line(’a’))
             j=0
          endif
       enddo
       iostat=system_putchar(new_line(’a’))
       end program demo_system_putchar

Results:

 >  !"#$%&’()*+,-./012
 > 3456789:;<=>?@ABCDE
 > FGHIJKLMNOPQRSTUVWX
 > YZ[\]^_‘abcdefghijk
 > lmnopqrstuvwxyz{|}~
 >


Nemo Release 3.1 system_putchar (3m_system) March 07, 2025
Generated by manServer 1.08 from dadf1b14-c2e1-4b98-bb33-6dbb15c49737 using man macros.