Portability Function: Writes a character to the file specified by a Fortran external unit, bypassing normal Fortran input/output.
Module: USE DFPORT
Syntax
Results:
The result is of type INTEGER(4). The result is zero if the write was successful; otherwise, an error code, such as:
If you use WRITE, READ, or any other Fortran I/O statements with lunit, be sure to read Input and Output With Portability Routines in the Programmer's Guide.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also: I/O Formatting, Files, Devices, and Input/Output Hardware
Example
use dfport
integer*4 lunit, i4
character*26 string
character*1 char1
lunit = 1
open (lunit,file = 'fputc.dat')
do i = 1,26
char1 = char(123-i)
i4 = fputc(1,char1) !make valid writes
if (i4.ne.0) iflag = 1
enddo
rewind (1)
read (1,'(a)') string
print *, string