Difference between revisions of "MQCLOSE()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Close an open message queue
+
Function to close an open message queue
  
  
Line 8: Line 8:
  
 
==See Also==
 
==See Also==
[[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]],  [[MQRECEIVE()]], [[MQSEND()]]
+
[[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]],  [[MQRECEIVE()]], [[MQSEND()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]]
  
  

Latest revision as of 10:12, 5 July 2011

Purpose

Function to close an open message queue


Syntax

MQCLOSE(<expN>)


See Also

MQCREATE(), MQCURMSGS(), MQOPEN(), MQRECEIVE(), MQSEND(), MQUNLINK(), XML_DECODE(), XML_ENCODE(), XML_GATHER(), XML_SCATTER()


Description

The MQCLOSE() function is used to close an open message queue. The <expN> is the pointer to a queue opened with MQCREATE() or MQOPEN(). It returns .T. (true) if the queue is closed successfully. If an error occurs and it is unable to close the queue, it returns .F. (false) and the ERRNO() function can be checked to determine the error.

For more examples of handling message queues, please see the examples/mqueue programs in the software distribution.


Example

// Open up the queue for read/write access
mqdes=mqcreate("/myqueue2", 2)
if (mqdes < 0)
    messagebox(strerror()+",errno="+alltrim(str(error())))
    return
endif
// send a message to the queue
rc = mqsend(mqdes, "Test message")
if (rc < 0)
    messagebox(strerror()+",errno="+alltrim(str(error())))
    return
endif
mqclose(mqdes)


Products

Recital, Recital Server