$Lstr Windex: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(42 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Lstr_Windex}}
{{DISPLAYTITLE:$Lstr_Windex}}
<span class="pageSubtitle"><section begin="desc" />Return the position of a word within a long string<section end="desc" /></span>
<span class="pageSubtitle">Return the position of a word within a long string</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Windex function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Windex is <var>[[WordNumberIn (String function)|WordNumberIn]]</var>. Or, you may find the features of the [[StringTokenizer class|StringTokenizer]] to be more helpful.</p>


This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned.  
This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned.  


The $Lstr_Windex function accepts three arguments and returns a string result.  
The <var>$Lstr_Windex</var> function accepts three arguments and returns a string result.  


The first argument is an arbitrary string or longstring. This is a required argument.  
The first argument is an arbitrary string or longstring. This is a required argument.  
Line 13: Line 13:


The third argument is a string containing from 1 to 255 characters which are the delimiters for the longstring. This is an optional argument and defaults to a blank.
The third argument is a string containing from 1 to 255 characters which are the delimiters for the longstring. This is an optional argument and defaults to a blank.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RESULT = $Lstr_Windex(longstring, word, delims)
<p class="syntax"><span class="term">%result</span> = $Lstr_Windex(longstring, word, delims)
<section end="syntax" /></p>
<p class="caption">$Lstr_Windex function
</p>
</p>
<p class="caption">%RESULT is the position of :hp1.word:ehp1. within :hp1.longstring:ehp1..</p>


For example
<p><var class="term">%result</var> is the position of '''word''' within '''longstring'''.</p>
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')
 
==Examples==
<ol>
<li>To set %RES to "6":
<p class="code">%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')
</p>
</p>
sets %RES to "6.&CQ. and
 
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')
<li>To set %RES to "3":
 
<p class="code">%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')
</p>
</p>
sets %RES to "3&CQ.
</ol>


For more information see :hdref refid=lstr..
==See also==
 
<ul>
$Lstr_Windex is only available in ''[[Sirius Mods]]'' Version 6.5 and later.<p>
<li><var>[[Word (String function)|Word]]</var> - Select word from list of words
<li><var>[[Words (String function)|Words]]</var> - Sublist of list of words
<li><var>[[WordCount (String function)|WordCount]]</var> - Count words in list
<li><var>[[WordNumberIn and WordNumberOf (String functions)|WordNumberIn and WordNumberOf]]</var> - Word number of "needle" word within "haystack" list of words
</ul>


<p>
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>  
</ul>
</p>
</p>
<p class="caption">Products authorizing $Lstr_Windex
<p>
</p>
</p>


[[Category:$Functions|$Lstr_Windex]]
[[Category:$Functions|$Lstr_Windex]]

Latest revision as of 22:52, 20 September 2018

Return the position of a word within a long string

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Windex is WordNumberIn. Or, you may find the features of the StringTokenizer to be more helpful.

This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned.

The $Lstr_Windex function accepts three arguments and returns a string result.

The first argument is an arbitrary string or longstring. This is a required argument.

The second argument is an arbitrary string containing a single word. The word must have no occurrences of any of the delimiters in argument three, and may not be null. This is a required argument.

The third argument is a string containing from 1 to 255 characters which are the delimiters for the longstring. This is an optional argument and defaults to a blank.

Syntax

%result = $Lstr_Windex(longstring, word, delims)

%result is the position of word within longstring.

Examples

  1. To set %RES to "6":

    %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')

  2. To set %RES to "3":

    %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')

See also

Products authorizing $Lstr_Windex