cfunc.readt C Function/C Functions

cfunc.readt

Command cfunc.readt C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statements: readt

Which flavor of "readt" is dependent upon the command "type".

type Pick/BASIC statement

_CP_READT_ELSE readt result else * return -1
_CP_READT_L_ELSE readtl result else * return -1
_CP_READTX_ELSE readtx result else * return -1
_CP_READT_ONERR readt result onerr * return -1
_CP_READT_L_ONERR readtl result onerr * return -1
_CP_READTX_ONERR readtx result onerr * return -1

This function returns -1 if an error occurs. The error code is contained in _CP_errno. PE_TAPE indicates a tape error.
Syntax int _CP_readt(int type, CPSTR** result)
Options
Example
/*The following example prints the next tape block.*/

CPSTR * xx = _CP_str_null;

_CP_readt(_CP_READT_ELSE, xx);
_CP_print(xx);
Purpose
Related cfunc.introduction
cfunc.weof
cfunc.writet