$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" />Word number of first occurrence of word in phrase<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Word number of first occurrence of word in phrase<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Windex function is [[to be entered]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Windex function is the [[PositionOf (String function)]] or [[PositionIn (String function)]].</p>


This function finds the first occurrence of a word in a phrase.  
This function finds the first occurrence of a word in a phrase.  
Line 13: Line 13:


The third argument is a delimiter that separates words in the first argument string. This is an optional argument and defaults to blank.
The third argument is a delimiter that separates words in the first argument string. This is an optional argument and defaults to blank.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %NUM = $Windex(string, word, delim)
<p class="syntax"><section begin="syntax" /> %NUM = $Windex(string, word, delim)
Line 23: Line 24:
</p>
</p>


This statement sets %JUNK to 0:


This statement sets %JUNK to 0:
<p class="code"> %JUNK = $Windex('BOB CAROL TED ALICE', 'ROGER')
<p class="code"> %JUNK = $Windex('BOB CAROL TED ALICE', 'ROGER')
</p>
</p>


This statement sets %JUNK to 2:


This statement sets %JUNK to 2:
<p class="code"> %JUNK = $Windex('A WORD/OR TWO/BEFORE/I/GO', 'OR TWO', '/')
<p class="code"> %JUNK = $Windex('A WORD/OR TWO/BEFORE/I/GO', 'OR TWO', '/')
</p>
</p>
Line 42: Line 43:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p class="caption">Products authorizing $Windex
<p class="caption">Products authorizing $Windex
</p>
</p>


[[Category:$Functions|$Windex]]
[[Category:$Functions|$Windex]]

Revision as of 21:08, 8 February 2011

<section begin="desc" />Word number of first occurrence of word in phrase<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Windex function is the PositionOf (String function) or PositionIn (String function).

This function finds the first occurrence of a word in a phrase.

The $Windex function accepts three arguments and returns a numeric result that is the word number in the first argument string of the the second argument word.

The first argument is an arbitrary string.

The second argument is word that is to be located in the first argument. If the second argument string is not found, $Windex returns a 0.

The third argument is a delimiter that separates words in the first argument string. This is an optional argument and defaults to blank.

Syntax

<section begin="syntax" /> %NUM = $Windex(string, word, delim) <section end="syntax" />

$Windex Function

%NUM is either a word number or 0.

For example, this statement sets %JUNK to 3:

%JUNK = $Windex('BOB CAROL TED ALICE', 'TED')

This statement sets %JUNK to 0:

%JUNK = $Windex('BOB CAROL TED ALICE', 'ROGER')

This statement sets %JUNK to 2:

%JUNK = $Windex('A WORD/OR TWO/BEFORE/I/GO', 'OR TWO', '/')

Products authorizing $Windex