hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_file_line_read (x04bb)

Purpose

nag_file_line_read (x04bb) reads a single formatted record from an external file.

Syntax

[recin, ifail] = x04bb(nin, reclen)
[recin, ifail] = nag_file_line_read(nin, reclen)

Description

nag_file_line_read (x04bb) is used by NAG Library functions to read formatted records from an external file. All formatted input from an external file by NAG Library functions is performed by calls to nag_file_line_read (x04bb).

References

None.

Parameters

Compulsory Input Parameters

1:     nin – int64int32nag_int scalar
The Fortran unit number which identifies the file to be read from. If nin < 0nin<0 (not a valid Fortran unit number), then no input occurs.
2:     reclen – int64int32nag_int scalar
The maximum length of the record in characters.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     recin – string
The first LEN(recin) characters of the record read from unit nin, padded with trailing blanks if the record was shorter than LEN(recin).
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
An end-of-file was detected by the READ statement.
System-dependent errors may also occur if the unit specified by nin is not connected to an external file, or if a read error occurs.

Accuracy

Not applicable.

Further Comments

None.

Example

function nag_file_line_read_example
iounit = int64(4);
reclin = int64(40);
file = 'foo.data';
mode = int64(0);
[ifail] = nag_file_open(iounit, file, mode);
[recin, ifail] = nag_file_line_read(iounit, reclin);
[ifail] = nag_file_close(iounit)
 

ifail =

                    0


function x04bb_example
iounit = int64(4);
reclin = int64(40);
file = 'foo.data';
mode = int64(0);
[ifail] = x04ac(iounit, file, mode);
[recin, ifail] = x04bb(iounit, reclin);
[ifail] = x04ad(iounit)
 

ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013