ENCODE - Fortran

The ENCODE statement transfers data between internal files, encoding the transferred data from internal format to character format.

Note: This statement primarily provides the same function as the WRITE statement, using internal files. Except that the input is read from a numericscalar or array rather than a character string, the concept of multiple recordsis not supported. The record length is user specified. Where possible, use a WRITE statement instead of ENCODE in new programs to make them compatible with different Fortran 77 operating environments.

Syntax

ENCODE (n,f,target[,ERR=s][,IOSTAT=rn]) [iolist]

where
n is an integer expression specifying the number of characters to be translated to character format.
f is a format specifier

ERR=s See “Control Information List — cilist” for an explanation of this parameter.
IOSTAT=rn See “Control Information List — cilist” for an explanation of this parameter.

targetis a scalar reference or array indicating the destination of the characters after translation to external form.

iolistis an optional list specifying the source data,

Method of Operation
The relationship between the I/O list and the format specifier is the same as for formatted I/O. target is padded with blanks if fewer than n characters are transferred. The maximum number of characters transmitted is the maximum number possible for the target data type. If target is an array, the elements are processed in subscript order.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Fortran Topics