$Lstr Windex: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Return the position of a word within a long string<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Return the position of a word within a long string<section end="desc" /></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="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Lstr_Windex function.</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.  
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"><section begin="syntax" /> %RESULT = $Lstr_Windex(longstring, word, delims)
Line 18: Line 19:
<p class="caption">$Lstr_Windex function
<p class="caption">$Lstr_Windex function
</p>
</p>
<p class="caption">%RESULT is the position of :hp1.word:ehp1. within :hp1.longstring:ehp1..</p>
<p class="caption">%RESULT is the position of '''word''' within '''longstring'''.</p>


For example
For example
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')
</p>
</p>
sets %RES to "6.&CQ. and
 
sets %RES to "6" and
 
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')
<p class="code"> %RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')
</p>
</p>
sets %RES to "3&CQ.


For more information see :hdref refid=lstr..  
sets %RES to "3".  


$Lstr_Windex is only available in ''[[Sirius Mods]]'' Version 6.5 and later.<p>
$Lstr_Windex is only available in ''[[Sirius Mods]]'' Version 6.5 and later.


<p>
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius functions]]</li>
Line 41: Line 44:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
 
</ul>  
</ul>
</p>
</p>
<p class="caption">Products authorizing $Lstr_Windex
<p class="caption">Products authorizing $Lstr_Windex
</p>
</p>


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

Revision as of 14:28, 11 February 2011

<section begin="desc" />Return the position of a word within a long string<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Lstr_Windex function.

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

<section begin="syntax" /> %RESULT = $Lstr_Windex(longstring, word, delims) <section end="syntax" />

$Lstr_Windex function

%RESULT is the position of word within longstring.

For example

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

sets %RES to "6" and

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

sets %RES to "3".

$Lstr_Windex is only available in Sirius Mods Version 6.5 and later.

Products authorizing $Lstr_Windex