<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Thanks for the reply. Very much appreciated. Mr.
Smith's method seems to be very neat and I will try to implement that. I needed
the count method because a virtual List Control that displays the lexicon needs
to know number of entries in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2>Right now I am getting the count using a slightly
improved brute force:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2><STRONG>int GetNumEntries()</STRONG></FONT></DIV>
<DIV>
<P><FONT face=Verdana size=2><STRONG>{</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>// initial guess</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>int high = 10000, low = 0, mid = (high +
low)/2;</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>while ( high - low > 1 )
{</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>pModule->setPosition(sword::TOP);
pModule->increment(mid);</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>if( pModule->Error()
) high = mid;</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>else low = mid;</STRONG></FONT></P>
<P><BR><FONT face=Verdana size=2><STRONG>mid = (high + low)/2;
</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>}</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>return high;</STRONG></FONT></P>
<P><FONT face=Verdana size=2><STRONG>}<BR></STRONG></FONT></P>
<P><FONT face=Arial size=2>I am not sure what are the dangers in doing this (if
any).</FONT></P></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>