Difference between revisions of "MQCURMSGS()"

From Lianjapedia
Jump to: navigation, search
 
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Return the number of unread messages in the specified queue
 
Return the number of unread messages in the specified queue
 
  
 
==Syntax==
 
==Syntax==
 
MQCURMSGS(<expN>)
 
MQCURMSGS(<expN>)
 
  
 
==See Also==
 
==See Also==
[[MQCLOSE()]], [[MQCREATE()]], [[MQOPEN()]], [[MQRECEIVE()]], [[MQSEND()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]]
+
[[JSON_DECODE()]], [[JSON_DECODE_FILE()]], [[JSON_ENCODE()]], [[MQCLOSE()]], [[MQCREATE()]], [[MQOPEN()]], [[MQRECEIVE()]], [[MQSEND()]], [[MQSENDMESSAGE()]], [[MQUNLINK()]], [[XML_DECODE()]], [[XML_ENCODE()]], [[XML_GATHER()]], [[XML_SCATTER()]]
 
+
  
 
==Description==
 
==Description==
Line 15: 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().
 
For more examples of handling message queues, please see the examples/mqueue programs in the software distribution.
 
 
  
 
==Example==
 
==Example==
Line 40: Line 34:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Messaging]]
 
 
[[Category:Messaging Functions]]
 
[[Category:Messaging Functions]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Function Extensions]]

Latest revision as of 04:04, 30 March 2017

Purpose

Return the number of unread messages in the specified queue

Syntax

MQCURMSGS(<expN>)

See Also

JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), MQCLOSE(), MQCREATE(), MQOPEN(), MQRECEIVE(), MQSEND(), MQSENDMESSAGE(), MQUNLINK(), XML_DECODE(), XML_ENCODE(), XML_GATHER(), XML_SCATTER()

Description

The MQCURMSGS() function returns the current number of unread messages in the open queue specified by <expN>. 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)