$Abbrev: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 3: Line 3:
<span class="pageSubtitle"><section begin="desc" />Determine if string is abbreviation within list of words<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Determine if string is abbreviation within list of words<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Abbrev function is [[to be entered]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no direct OO equivalent for the $Abbrev function.</p>


This function makes it possible to determine if a string is a valid abbreviation of one of a list of words.  
This function makes it possible to determine if a string is a valid abbreviation of one of a list of words.  
Line 20: Line 20:
<p class="code">  
<p class="code">  
  >0 - Number of matching word
  >0 - Number of matching word
0 - No matches found
  0 - No matches found
  -1 - First parameter missing or null
  -1 - First parameter missing or null
  -2 - Second parameter missing or null
  -2 - Second parameter missing or null

Revision as of 15:50, 31 January 2011


<section begin="desc" />Determine if string is abbreviation within list of words<section end="desc" />

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

This function makes it possible to determine if a string is a valid abbreviation of one of a list of words.

$Abbrev accepts two arguments and returns a numeric code.

The first argument is a list of blank-delimited words.

The second argument is the word to be compared with the blank-delimited word list in the first argument.

Syntax

<section begin="syntax" /> %RESULT = $Abbrev(word_list, string) <section end="syntax" />

$Abbrev Function

%RESULT indicates the relative position in word_list of the first word for which string is a valid abbreviation.

>0 - Number of matching word 0 - No matches found -1 - First parameter missing or null -2 - Second parameter missing or null

$Abbrev return codes


In the following example

%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B')

%NUM is set to 2.

In the following example

%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M')

%NUM is set to 3.

In the following example

%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU')

%NUM is set to 4.

In the following example

%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP')

%NUM is set to 1.

In the following example

%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD')

%NUM is set to 0.

Products authorizing $Abbrev