Difference between revisions of "AMOSi:Match"
Spellcoder (talk | contribs) m (1 revision(s)) |
Spellcoder (talk | contribs) m (1 revision(s)) |
(No difference)
|
Latest revision as of 01:51, 17 November 2007
an example can be found on AMOSPro_Examples:Examples/H-0/Help_4.AMOS
Searches through a sorted array for your chosen value. If the search is successful, you'll get it's index number as the return value. But if the search fails, you'll get a NEGATIVE result instead. This holds the index number of the item which came closest to your search parameter muliplied by -1.
Match works equally well with all types of arrays. However, you'll need to SORT the array before you make the test. See the SORT function.
item=Match(t(0),s)
item=Match(t#(0),s#)
item=Match(t$(0),s$)