<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.signature.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Fpos</id>
		<title>IB Statements/pos - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Fpos"/>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pos&amp;action=history"/>
		<updated>2026-05-04T20:37:46Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.signature.net/index.php?title=IB_Statements/pos&amp;diff=4070&amp;oldid=prev</id>
		<title>Jim: Needle/Haystack</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pos&amp;diff=4070&amp;oldid=prev"/>
				<updated>2015-08-17T19:03:09Z</updated>
		
		<summary type="html">&lt;p&gt;Needle/Haystack&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:03, 17 August 2015&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''POS function''' &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''POS function''' &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Syntax:'''&amp;nbsp; POS(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-1&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-2&lt;/del&gt;)&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Syntax:'''&amp;nbsp; POS(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Needle&amp;quot;&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Haystack&amp;quot;&lt;/ins&gt;)&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Discussion:'''&amp;nbsp; The POS function returns the position of one specified string argument within a second string argument. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;'''Discussion:'''&amp;nbsp; The POS function returns the position of one specified string argument within a second string argument. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The first string argument (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-1&lt;/del&gt;) is a string value whose position within the second string argument is to be determined. The second string argument (&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-2&lt;/del&gt;) is the string value to be searched for the first string argument. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The first string argument (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Needle&amp;quot;&lt;/ins&gt;) is a string value whose position within the second string argument is to be determined. The second string argument (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Haystack&amp;quot;&lt;/ins&gt;) is the string value to be searched for the first string argument. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Both string arguments can be string constants, single-element string variables, or string array elements. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Both string arguments can be string constants, single-element string variables, or string array elements. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Either the first or the second string argument (but not both) can be a string expression or a string function. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Either the first or the second string argument (but not both) can be a string expression or a string function. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The value returned by the POS function is the position within &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-2 &lt;/del&gt;of the first character of the first occurrence (from left to right) of a substring equal to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-1&lt;/del&gt;. For internal string values, counting begins at character position 1. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The value returned by the POS function is the position within &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Haystack&amp;quot; &lt;/ins&gt;of the first character of the first occurrence (from left to right) of a substring equal to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Needle&amp;quot;&lt;/ins&gt;. For internal string values, counting begins at character position 1. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-1 &lt;/del&gt;does not equal a substring of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;string-2&lt;/del&gt;, the POS function returns a value of zero. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Needle&amp;quot; &lt;/ins&gt;does not equal a substring of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Haystack&amp;quot;&lt;/ins&gt;, the POS function returns a value of zero. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The intermediate result of the POS function is stored in an accumulator with a precision of 16.8 If this result is then stored in a receiving numeric variable, its precision is adjusted to the defined precision of that variable. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The intermediate result of the POS function is stored in an accumulator with a precision of 16.8 If this result is then stored in a receiving numeric variable, its precision is adjusted to the defined precision of that variable. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:410:newid:4070 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jim</name></author>	</entry>

	<entry>
		<id>http://wiki.signature.net/index.php?title=IB_Statements/pos&amp;diff=410&amp;oldid=prev</id>
		<title>Badge: New page: '''POS function'''   '''Syntax:'''  POS(string-1, string-2)    '''Discussion:'''  The POS function returns the position of one specified string argument within a second string argument.  T...</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pos&amp;diff=410&amp;oldid=prev"/>
				<updated>2009-05-22T09:30:05Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &amp;#39;&amp;#39;&amp;#39;POS function&amp;#39;&amp;#39;&amp;#39;   &amp;#39;&amp;#39;&amp;#39;Syntax:&amp;#39;&amp;#39;&amp;#39;  POS(string-1, string-2)    &amp;#39;&amp;#39;&amp;#39;Discussion:&amp;#39;&amp;#39;&amp;#39;  The POS function returns the position of one specified string argument within a second string argument.  T...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''POS function''' &lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''  POS(string-1, string-2)  &lt;br /&gt;
&lt;br /&gt;
'''Discussion:'''  The POS function returns the position of one specified string argument within a second string argument. &lt;br /&gt;
The first string argument (string-1) is a string value whose position within the second string argument is to be determined. The second string argument (string-2) is the string value to be searched for the first string argument. &lt;br /&gt;
&lt;br /&gt;
Both string arguments can be string constants, single-element string variables, or string array elements. &lt;br /&gt;
&lt;br /&gt;
Either the first or the second string argument (but not both) can be a string expression or a string function. &lt;br /&gt;
&lt;br /&gt;
The value returned by the POS function is the position within string-2 of the first character of the first occurrence (from left to right) of a substring equal to string-1. For internal string values, counting begins at character position 1. &lt;br /&gt;
&lt;br /&gt;
If string-1 does not equal a substring of string-2, the POS function returns a value of zero. &lt;br /&gt;
&lt;br /&gt;
The intermediate result of the POS function is stored in an accumulator with a precision of 16.8 If this result is then stored in a receiving numeric variable, its precision is adjusted to the defined precision of that variable. &lt;br /&gt;
 &lt;br /&gt;
'''Example 1:'''  X = POS(A$,B$)&lt;br /&gt;
&lt;br /&gt;
In the above example, the value contained in the string variable A$ is compared to the value stored in B$. If a match is found, the POS function returns the matching position; this value is then stored in the numeric variable X. &lt;br /&gt;
&lt;br /&gt;
For example, if A$ equals &amp;quot;AT&amp;quot; and B$ equals &amp;quot;SIGNATURE&amp;quot;, then the POS function will return a value of 5 (the starting position of the string &amp;quot;AT&amp;quot; within the value &amp;quot;SIGNATURE&amp;quot;.) &lt;br /&gt;
 &lt;br /&gt;
'''Example 2:'''  VALUE = POS(STR$,&amp;quot;ABCDEF&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
In this example, the value of string variable STR$ is compared to the string constant &amp;quot;ABCDEF&amp;quot;. If the value of STR$ matches a portion of the constant, its position is returned and stored in the numeric variable VALUE. &lt;br /&gt;
For example, if STR$ equals &amp;quot;B&amp;quot;, the function will return a value of 2 (since &amp;quot;B&amp;quot; is in the second position of the string constant). &lt;br /&gt;
&lt;br /&gt;
Or, if STR$ equals &amp;quot;Z&amp;quot;, the function will return a value of zero, since &amp;quot;Z&amp;quot; is not contained in the constant. &lt;br /&gt;
&lt;br /&gt;
Also, if STR$ equals &amp;quot;DE&amp;quot;, the function will return a value of 4 (the substring &amp;quot;DE&amp;quot; starts at the fourth position of the constant). &lt;br /&gt;
 &lt;br /&gt;
'''Example 3:'''  N = POS(&amp;quot;SMITH&amp;quot;,NAME$)&lt;br /&gt;
&lt;br /&gt;
In this example, the string constant &amp;quot;SMITH&amp;quot; is compared to the string variable NAME$. If &amp;quot;SMITH&amp;quot; is located anywhere within NAME$, its position will be returned and stored in the numeric variable N. &lt;br /&gt;
&lt;br /&gt;
Note: If &amp;quot;SMITH&amp;quot; is not found in the variable NAME$, the POS function will return a value of zero. This programming technique can be useful for determining if a particular string value is contained within a specific data field.&lt;/div&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	</feed>