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