_CP_readt is equivalent to the readt BASIC statement.

Which flavor of readt is dependent upon the command type:

Type 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


int _CP_readt(int type, CPSTR** result)


This function returns -1 if an error occurs. The error code is contained in _CP_errno. PE_TAPE indicates a tape error.

Note: The tape must have been already attached.


/* Prints the next tape block. */
CPSTR * xx = _CP_str_null;
_CP_readt(_CP_READT_ELSE, xx);