MQCREATE()

From Recital Documentation Wiki
Revision as of 17:25, 17 November 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Template:YLM to do

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 MQOPEN() function opens an existing 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 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
? ?
? ?
? ?
? ?


The MQCLOSE() function is used to close a queue which has been opened with MQOPEN().


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)
end do
mqclose(mqdes)


Products

Recital, Recital Server