MQCURMSGS()

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

Jump to: navigation, search

Template:YLM to do

Purpose

Return the number of unread messages in the specified queue


Syntax

MQCURMSGS(<expN>)


See Also

MQCLOSE(), MQCREATE(), MQOPEN(), MQRECEIVE(), MQSEND()


Description

The MQCURMSGS() function returns the current number of unread messages in the queue specified by <expN>.


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