ATMI COBOL Function Reference
|
|
TPGETUNSOL() - get unsolicited message
01TPTYPE-REC.
COPY TPTYPE.
01DATA-REC.
COPY User data.
01TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPGETUNSOL" USINGTPTYPE-RECDATA-RECTPSTATUS-REC.
TPGETUNSOL() gets unsolicited messages that were sent via TPBROADCAST() or TPNOTIFY(). This routine may only be called from an unsolicited message handler.
Upon successful return, LEN IN TPTYPE_REC contains the actual number of bytes moved into DATA-REC. REC-TYPE and SUB-TYPE, both in TPTYPE-REC, contain the data's type and subtype, respectively. If the message is larger than DATA-REC, then DATA-REC will contain only as many bytes as will fit in the record. The remainder of the message is discarded and sets TPTRUNCATE(). If LEN is 0, upon successful completion, then the message has no data portion and DATA-REC was not modified.
It is an error for LEN to be 0 on input.
Upon successful completion, TPGETUNSOL() sets TP-STATUS to [TPOK]. If the size of the incoming message was larger then the size specified in LEN on input, TPTRUNCATE() is set and only LEN amount of data was moved to DATA-REC, the remaining data is discarded.
Under the following conditions, TPGETUNSOL() fails and sets TP-STATUS to:
|
|
|