Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
No edit summary
Line 29: Line 29:
   
 
The following code does not produce the results I expected. First pass (assume that it should find 10 people) sends 'numWhos = 0 totalCount = 0' to the chat frame. Second pass (assume that it should find 1 person) sends 'numWhos = 10 totalCount = 10' to the chat frame. Third pass sends 'numWhos = 1 totalCount = 1' to the chat frame. GetNumWhoResults() seems to be one step behind [[API SendWho|SendWho]]().
 
The following code does not produce the results I expected. First pass (assume that it should find 10 people) sends 'numWhos = 0 totalCount = 0' to the chat frame. Second pass (assume that it should find 1 person) sends 'numWhos = 10 totalCount = 10' to the chat frame. Third pass sends 'numWhos = 1 totalCount = 1' to the chat frame. GetNumWhoResults() seems to be one step behind [[API SendWho|SendWho]]().
 
(double checking my results)
 
   
 
SendWho(filter);
 
SendWho(filter);

Revision as of 20:08, 6 March 2007

Title -Documentation by Mikk-

Get the number of entries resulting from your most recent /who query.

  numWhos, totalCount = GetNumWhoResults();

Parameters

Returns

Returns
totalCount, numWhos
totalCount
Number - number of users matching the query
numWhos
Number - number of entries actually returned

Normally, these two will be returned as the same number.

However, if the query matched more players than the server wants to return (currently 49), totalCount will be returned as 50 and numWhos will be returned as 49. Hence, totalCount being greater than numWhos seems to be a future-safe indication of the list having been truncated.


FrameXML has these two names swapped around, but I suspect that it is a bug. There is code to display a warning about the list being truncated, but it never triggers.




Comment by egingell

The following code does not produce the results I expected. First pass (assume that it should find 10 people) sends 'numWhos = 0 totalCount = 0' to the chat frame. Second pass (assume that it should find 1 person) sends 'numWhos = 10 totalCount = 10' to the chat frame. Third pass sends 'numWhos = 1 totalCount = 1' to the chat frame. GetNumWhoResults() seems to be one step behind SendWho().

SendWho(filter);
local numWhos, totalCount = GetNumWhoResults(); 
DEFAULT_CHAT_FRAME:AddMessage('numWhos = '..tostring(numWhos).. ' totalCount = '..tostring(totalCount));