$Abbrev: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 7: | Line 7: | ||
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. | ||
< | ==Syntax== | ||
<p class="syntax"><section begin="syntax" />%result = $Abbrev(word_list, string) | |||
<section end="syntax" /></p> | |||
<p>%result is a numeric value that indicates the relative position in <var class="term">word_list</var> of the first word for which string is a valid abbreviation.</p> | |||
The first argument is a list of blank-delimited words. | The first argument is a list of blank-delimited words. | ||
The second argument is the word to be compared with the blank-delimited | The second argument is the word to be compared with the blank-delimited <var class="term">word_list</var> argument. | ||
< | |||
===Return codes=== | |||
<p class="code"> | <p class="code">>0 - Number of matching word | ||
0 - No matches found | |||
-1 - First parameter missing or null | |||
-2 - Second parameter missing or null | |||
</p> | </p> | ||
==Examples== | ==Examples== | ||
In the following example | <ol> | ||
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B') | <li>In the following example, %NUM is set to 2: | ||
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B') | |||
</p> | </p> | ||
In the following example | <li>In the following example, %NUM is set to 3: | ||
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M') | <p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M') | ||
</p> | </p> | ||
In the following example | <li>In the following example, %NUM is set to 4: | ||
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU') | <p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU') | ||
</p> | </p> | ||
In the following example | <li>In the following example, %NUM is set to 1: | ||
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP') | <p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP') | ||
</p> | </p> | ||
In the following example | <li>In the following example, %NUM is set to 0: | ||
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD') | <p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD')</p> | ||
</ | </ol> | ||
<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | <h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[Sirius functions]]</li> |
Revision as of 00:48, 26 October 2012
Determine if string is abbreviation within list of words
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.
Syntax
<section begin="syntax" />%result = $Abbrev(word_list, string) <section end="syntax" />
%result is a numeric value that indicates the relative position in word_list of the first word for which string is a valid abbreviation.
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 argument.
Return codes
>0 - Number of matching word 0 - No matches found -1 - First parameter missing or null -2 - Second parameter missing or null
Examples
- In the following example, %NUM is set to 2:
%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B')
- In the following example, %NUM is set to 3:
%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M')
- In the following example, %NUM is set to 4:
%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU')
- In the following example, %NUM is set to 1:
%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP')
- In the following example, %NUM is set to 0:
%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD')
Products authorizing $Abbrev
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility