Difference between revisions of "MQOPEN()"
From Lianjapedia
Yvonne.milne (Talk | contribs) (→Purpose) |
|||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | Open a | + | Open a handle to a message queue |
− | + | ||
==Syntax== | ==Syntax== | ||
MQOPEN(<expC> [,<expN>]) | MQOPEN(<expC> [,<expN>]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQRECEIVE()]], [[MQSEND()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]] | + | [[JSON_DECODE()]], [[JSON_DECODE_FILE()]], [[JSON_ENCODE()]], [[MQCLOSE()]], [[MQCREATE()]], [[MQCURMSGS()]], [[MQRECEIVE()]], [[MQSEND()]], [[MQSENDMESSAGE()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]] |
− | + | ||
==Description== | ==Description== | ||
− | The MQOPEN() function opens an existing message queue. It returns a numeric | + | The MQOPEN() function opens an existing message queue. It returns a numeric handle when the queue is opened successfully, or a -1 if unsuccessful. The <expC> is the name of the queue to open. Since the handle is required to identify an open queue to other messaging functions, always assign the return value to a variable. The optional <expN> determines the queue access mode: |
− | + | ||
− | {| class="wikitable" | + | {| class="wikitable" width="100%" |
!<expN>||Access Mode | !<expN>||Access Mode | ||
|- | |- | ||
Line 27: | Line 23: | ||
|- | |- | ||
|} | |} | ||
− | |||
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 52: | Line 44: | ||
</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 03:57, 10 April 2017
Contents
Purpose
Open a handle to a message queue
Syntax
MQOPEN(<expC> [,<expN>])
See Also
JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), MQCLOSE(), MQCREATE(), MQCURMSGS(), MQRECEIVE(), MQSEND(), MQSENDMESSAGE(), MQUNLINK(), XML_DECODE(), XML_ENCODE(), XML_GATHER(), XML_SCATTER()
Description
The MQOPEN() function opens an existing message queue. It returns a numeric handle when the queue is opened successfully, or a -1 if unsuccessful. The <expC> is the name of the queue to open. Since the handle is required to identify an open queue to other messaging functions, always assign the return value to a variable. The optional <expN> determines the queue access mode:
<expN> | Access Mode |
---|---|
Unspecified | Read only access |
0 | Read only access |
1 | Write only access |
2 | Read/Write access |
The MQCLOSE() function is used to close a queue which has been opened with MQOPEN() or MQCREATE().
Example
mqdes=mqopen("/myqueue") if (mqdes < 0) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif do while (mqcurmsgs(mqdes) > 0) mstr=mqreceive(mqdes) if (empty(mstr)) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif messagebox(mstr) enddo mqclose(mqdes)