SNAX/HLS Configuration and Control Manual

Step 5. Planning for Programming Standards
Planning the SNAX/HLS Environment
2–26 104705 Tandem Computers Incorporated
IF kind < 0 THEN
BEGIN
.
. ! We have an FMH in the data.
. ! The first byte of the data is the FMH length,
. ! followed by the FMH type byte, followed by FMH data.
.
. ! FMHs may be concatenated, but we assume that
. ! only one FMH is present.
.
. FMH^CONTINUED := RECEIVE^DATA^REPLY.USER^DATA.<8>;
.
. FMH^LENGTH := RECEIVE^DATA^REPLY.USER^DATA.<9:15>;
.
. FMH^TYPE := RECEIVE^DATA^REPLY.USER^DATA[1].<8:15>;
.
. MESSAGE^LENGTH := RECEIVE^DATA^REPLY.USER^DATA^LENGTH
. - FMH^LENGTH;
.
. ! We assume that the FMH is not relevant to
. ! application processing, and strip the
. ! FMH from the data.
.
. RECEIVE^DATA^REPLY.USER^DATA^S ':='
. RECEIVE^DATA^REPLY.USER^DATA^S[FMH^LENGTH]
. FOR MESSAGE^LENGTH;
. ! We now pretend that this is original partner data.
. ! In a real application, this would not be correct.
.
. KIND := dt^partner^data;
.
END;
!
! In the variable "KIND" is stored the data type
! of the message just received. The rest of the
! subroutine contains one large CASE statement.
! Note the use of the labeled cases.
!
CASE KIND OF BEGIN
DT^PARTNER^DATA ->
.
. ! RECEIVE^DATA^REPLY.DATA^TYPE^RECEIVED = 0
. ! The message is from the session partner
.
. CALL PROCESS^PARTNER^DATA;
.