<!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.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am working on a stack to query against 
a&nbsp;text file&nbsp;and then display the results in a field within the card 
using the "filter" command.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Now I am working on a script to count a string of 
text within the filtered field.&nbsp; Here is the script:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>==============================================================</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>on mouseup</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; --setting things up&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; <BR>&nbsp; put empty into field "Hits"<BR>&nbsp; put the 
number of lines of field "Results" into lCount<BR>&nbsp; put 0 into 
x</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; -- asking for input<BR>&nbsp; ask "What do 
you want me to count?"<BR>&nbsp; put it into cVar</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; -- exitting the script upon Cancel<BR>&nbsp; 
if cVar is empty then<BR>&nbsp;&nbsp;&nbsp; exit mouseUp<BR>&nbsp; 
else<BR>&nbsp; <BR>&nbsp;&nbsp;&nbsp; -- finding the first instance 
and<BR>&nbsp;&nbsp;&nbsp; -- setting a marker using 
foundLine<BR>&nbsp;&nbsp;&nbsp; find cVar in field 
"Results"<BR>&nbsp;&nbsp;&nbsp; put the foundLine into y<BR>&nbsp;&nbsp;&nbsp; 
add 1 to x<BR>&nbsp; <BR>&nbsp;&nbsp;&nbsp; -- counting&nbsp;the other 
instances<BR>&nbsp;&nbsp;&nbsp; repeat until x = 
lCount<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find cVar in field 
"Results"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if the foundLine = y 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 
repeat<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else add 1 to x<BR>&nbsp;&nbsp;&nbsp; 
end repeat<BR>&nbsp; <BR>&nbsp; end if</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; -- here's what I found<BR>&nbsp; put "Search 
string = " &amp; cVar into line 1 of field "Hits"<BR>&nbsp; if x=1 
then<BR>&nbsp;&nbsp;&nbsp; put "# of hits = " &amp; x into line 2 of field 
"Hits"<BR>&nbsp; else put "# of hits = " &amp; (x-1) into line 2 of field 
"Hits"<BR>&nbsp; put "# of lines searched = " &amp; the number of lines of field 
"Results" into line 3 of field "Hits"</FONT></DIV><FONT face=Arial size=2>
<DIV><BR>end mouseup<BR></DIV>
<DIV>==============================================================</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now for the problem.&nbsp; What I am seeing is that when I execute this 
script and enter a string of text sometimes the script only counts 1 item when I 
see there are over half a dozen instances of the string.&nbsp; Yes I&nbsp;have 
found&nbsp;this is a case sensitive search.&nbsp; Most of the instances are 
contained in a single&nbsp;record and often involve SMTP 
addresses.&nbsp;&nbsp;Are there some characters which the "find" command does 
not work with.&nbsp; I didn't find anything in the doco to validate this, but I 
am beginning to suspect this to be true.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have tried various combinations of the 'find' command including it with 
the 'whole', 'chars', and 'string' modifiers, but nothing seems to help.&nbsp; 
The funny thing is sometimes this works just like it is supposed to.&nbsp; Other 
times it can't find more than 1 instance of the string.</DIV>
<DIV>&nbsp;</DIV>
<DIV>This is driving me batty.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any ideas on what I have missed here.</DIV>
<DIV>&nbsp;</DIV>
<DIV>TIA</DIV>
<DIV>&nbsp;</DIV>
<DIV>Nate</DIV></FONT></BODY></HTML>