RCVID

Change the default name referenced by RECV

WSupported on Windows
USupported on Unix
VSupported on OpenVMS

 

xcall RCVID([new_id])

Arguments

new_id

(optional) A field that contains the new default message ID. New_id can have up to six characters on Windows and Unix and up to 39 characters on OpenVMS. (a)

Discussion

The RCVID subroutine changes the default name that the RECV statement references when “[SELF]” is specified in the statement as the message ID.

Normally, if the third argument (id) in the RECV statement is [SELF], Synergy DBL assumes that the message ID is the first six characters of the receiving program’s name. You can change this default by calling the RCVID subroutine and passing a different message ID.

If you don’t specify new_id (or if it’s null), the original default program name is restored as the default ID name.

See also

Special message IDs

Examples

The example below changes the default message ID to test, receives a message with that ID, changes the default ID back to the first six characters of the filename (proga, which in this case only has five characters), and then receives a message with the proga message ID.

.name proga
.define TTCHN   ,1
record
    newid       ,a6,    "test"
    data        ,a50
    leng        ,d3
proc
    open(TTCHN, o, "tt:")
    xcall rcvid(newid)                 ;Change default ID to "test"
    recv(data, err, "[SELF]", leng)    ;Receive message with ID "test"
    xcall rcvid                        ;Change default ID back to "proga"
    recv(data, err, "[SELF]", leng)    ;Receive message with ID "proga"
    stop
err, 
    forms(TTCHN, 1)
    display(TTCHN, "No message was received")
    close
    stop
end