Difference between revisions of "MQCREATE()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 29: | Line 29: | ||
− | The MQCLOSE() function is used to close a queue which has been opened with MQCREATE(). | + | The MQCLOSE() function is used to close a queue which has been opened with MQCREATE() or MQOPEN(). |
Revision as of 11:15, 19 November 2009
Purpose
Create a message queue and open a pointer to the queue
Syntax
MQCREATE(<expC> [,<expN>])
See Also
MQCLOSE(), MQCURMSGS(), MQOPEN(), MQRECEIVE(), MQSEND()
Description
The MQCREATE() function creates and opens a new message queue. It returns a numeric pointer when the queue is opened successfully, or a -1 if unsuccessful. The <expC> is the name of the queue to create and open. Since the pointer is required to identify an open queue to other messaging functions, always assign the return value to a memory 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 MQCREATE() or MQOPEN().
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