$ListFind: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Find string in $list<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Find string in $list<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListFind function | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListFind function are the [[Find and FindUp (Stringlist functions)]].</p> | ||
This function locates a $list item that exactly matches a specified string. | This function locates a $list item that exactly matches a specified string. | ||
The $ListFind function accepts three arguments and returns the item number of the $list item that matches the string or an error code. It is a callable $function ( | The $ListFind function accepts three arguments and returns the item number of the $list item that matches the string or an error code. It is a callable $function (see [[Calling Sirius Mods $functions]]). | ||
The first argument is the identifier of the $list in which a string is to be located. This is a required argument. | The first argument is the identifier of the $list in which a string is to be located. This is a required argument. | ||
Line 15: | Line 14: | ||
The third argument is a number that indicates the item number at which the search is to begin. If this argument is not specified searching begins at the first item in the $list. | The third argument is a number that indicates the item number at which the search is to begin. If this argument is not specified searching begins at the first item in the $list. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListFind(list_identifier, search_string, | <p class="syntax"><section begin="syntax" /> [%RESULT =] $ListFind(list_identifier, search_string, start_item) | ||
start_item) | |||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
<p class="caption">$ListFind Function | <p class="caption">$ListFind Function | ||
Line 31: | Line 30: | ||
</p> | </p> | ||
The difference between $ListFind and [[$ListLoc]] is that with $ListFind, a $list item must match the search string exactly rather than simply containing the search string. Moreover, $ListFind does not allow specification of a range of columns (or positions) that are to be searched.<p> | |||
The difference between $ListFind and $ListLoc is that with $ | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
Line 43: | Line 41: | ||
<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 $ListFind | <p class="caption">Products authorizing $ListFind | ||
</p> | </p> | ||
[[Category:$Functions|$ListFind]] | [[Category:$Functions|$ListFind]] |
Revision as of 14:32, 10 February 2011
<section begin="desc" />Find string in $list<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListFind function are the Find and FindUp (Stringlist functions).
This function locates a $list item that exactly matches a specified string.
The $ListFind function accepts three arguments and returns the item number of the $list item that matches the string or an error code. It is a callable $function (see Calling Sirius Mods $functions).
The first argument is the identifier of the $list in which a string is to be located. This is a required argument.
The second argument is the string to be matched. This is a required argument.
The third argument is a number that indicates the item number at which the search is to begin. If this argument is not specified searching begins at the first item in the $list.
Syntax
<section begin="syntax" /> [%RESULT =] $ListFind(list_identifier, search_string, start_item) <section end="syntax" />
-5 - Required argument not specified -6 - $List identifier invalid -7 - Item number not found in $list -8 - String not found (if $list empty, -7)
The difference between $ListFind and $ListLoc is that with $ListFind, a $list item must match the search string exactly rather than simply containing the search string. Moreover, $ListFind does not allow specification of a range of columns (or positions) that are to be searched.