Difference between revisions of "MQRECEIVE()"
From Lianjapedia
Helen.george (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
==See Also== | ==See Also== | ||
− | [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]], [[MQSEND()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]] | + | [[JSON_DECODE()]], [[JSON_DECODE_FILE()]], [[JSON_ENCODE()]], [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQOPEN()]], [[MQSEND()]], [[MQSENDMESSAGE()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]] |
==Description== | ==Description== | ||
Line 12: | Line 12: | ||
The MQCLOSE() function is used to close a queue which has been opened with MQOPEN() or MQCREATE(). | The MQCLOSE() function is used to close a queue which has been opened with MQOPEN() or MQCREATE(). | ||
− | |||
− | |||
==Example== | ==Example== | ||
Line 36: | Line 34: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:Messaging Functions]] | [[Category:Messaging Functions]] | ||
[[Category:Lianja VFP Extensions]] | [[Category:Lianja VFP Extensions]] | ||
[[Category:VFP Function Extensions]] | [[Category:VFP Function Extensions]] |
Latest revision as of 04:05, 30 March 2017
Contents
Purpose
Get a message from an open message queue
Syntax
MQRECEIVE(<expN>)
See Also
JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), MQCLOSE(), MQCREATE(), MQCURMSGS(), MQOPEN(), MQSEND(), MQSENDMESSAGE(), MQUNLINK(), XML_DECODE(), XML_ENCODE(), XML_GATHER(), XML_SCATTER()
Description
The MQRECEIVE() function gets a message from an open message queue. It returns the message as a character string. If an error occurs and it is unable to get the message, it returns an empty string and the ERRNO() function can be checked to determine the error. The <expN> is the pointer to a queue opened with MQCREATE() or MQOPEN().
The MQCLOSE() function is used to close a queue which has been opened with MQOPEN() or MQCREATE().
Example
// Open up the queue for reading mqdes=mqopen("/myqueue") if (mqdes < 0) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif // do while there are messages do while (mqcurmsgs(mqdes) > 0) // Get each message mstr=mqreceive(mqdes) if (empty(mstr)) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif messagebox(mstr) enddo mqclose(mqdes)