<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="monospace">Richard,<br>
<br>
I use instr quite a bit and the number returned is always from the
beginning, even if you start in the middle of the string to look.<br>
<br>
So if I had a string that has:<br>
<br>
xx="<Name>George Jetson</Name>"<br>
<br>
If you do instr(xx,"Name","1") you will get "2"<br>
If you do instr(xx,"Name,"3") you will get "22" (If I counted
right)<br>
<br>
I use this for taking apart strings all the time and this is how
the math works.<br>
<br>
Nancy<br>
</font><br>
<div class="moz-cite-prefix">On 12/16/2020 12:56 PM, Richard Kreiss
via Filepro-list wrote:<br>
</div>
<blockquote type="cite"
cite="mid:MN2PR04MB67675AF0E87A51D23060DEB3B7C50@MN2PR04MB6767.namprd04.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">Field="Quick Brown Fox behind A tree"
QQ=instr(field,"B"); in this case QQ will equal "7" as the first B (Brown) is in the seventh position. If qq=instr,"B","8") is the value of qq "17" which is the value from the starting position or 10 the value from the
Both these functions yield the first occurrence of a value. Instr(field,"A",{optional starting point]). So, my question is if field has more than one iteration of "A", and the optional starting point is set past where "A" first appears in the 10th position. Will the next iteration of "A" be at "10, which is the value formn where the search started?.
This would also be same thing for strtok() with regards to position of the value found.
Yes, I could test this out but I thought you all might want to thing about it as you might be using these functions and the manual is not clear on this subject except to indicate that one may need to move the starting point of the search forward of the point of the first occurrence if the value being searched for occurs more than once.
Richard Kreiss
GCC Consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 13896 bytes
Desc: not available
URL: <a class="moz-txt-link-rfc2396E" href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20201216/4fae277c/attachment.bin"><http://mailman.celestial.com/pipermail/filepro-list/attachments/20201216/4fae277c/attachment.bin></a>
_______________________________________________
Filepro-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>
Subscribe/Unsubscribe/Subscription Changes
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/mailman/listinfo/filepro-list">http://mailman.celestial.com/mailman/listinfo/filepro-list</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: <a class="moz-txt-link-freetext" href="http://www.vss3.com">http://www.vss3.com</a>
</pre>
</body>
</html>