$Abbrev: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(Automatically generated page update)
 
(54 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Abbrev}}
{{DISPLAYTITLE:$Abbrev}}
<span class="pageSubtitle">Determine if string is abbreviation within list of words</span>


<span class="pageSubtitle"><section begin="desc" />Determine if string is abbreviation within list of words<section end="desc" /></span>
<p class="warn"><b>Note:</b> <i>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no direct OO equivalent for <var>$Abbrev</var>.  However, the <var>[[IsStartOf (String function)|IsStartOf]]</var> function can be used to determine whether one string is an initial substring (abbreviation) of another.</i></p>


<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>
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"><span class="term">%result</span> = <span class="literal">$Abbrev</span>(<span class="term">word_list</span>, <span class="term">string</span>)
</p>


This function makes it possible to determine if a string is a valid abbreviation of one of a list of words.  
===Syntax terms===
<table>
<tr><th>%result</th>
<td>A numeric value that indicates the relative position in <var class="term">word_list</var> of the first word for which <var class="term">string</var> is a valid abbreviation.</td></tr>


$Abbrev accepts two arguments and returns a numeric code.  
<tr><th>word_list</th>
<td>A list of blank-delimited words. </td></tr>


The first argument is a list of blank-delimited words.  
<tr><th>string</th>
<td>The word to be compared with the <var class="term">word_list</var> argument. </td></tr>
</table>


The second argument is the word to be compared with the blank-delimited word list in the first argument.
===Return codes===
==Syntax==
<p class="code">>0 - Number of matching word
<p class="syntax"><section begin="syntax" /> %RESULT = $Abbrev(word_list, string)
<section end="syntax" /></p>
<p class="caption">$Abbrev Function
</p>
<p class="caption">%RESULT indicates the relative position in word_list of the first word for which string is a valid abbreviation.</p>
<p class="code">  
>0 - Number of matching word
  0 - No matches found
  0 - No matches found
-1 - First parameter missing or null
-2 - First parameter missing or null
-2 - Second parameter missing or null
-1 - Second parameter missing or null
</p>
</p>
<p class="caption">$Abbrev return codes
 
==Examples==
<ol>
<li>In the following example, %NUM is set to 2:
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B')
</p>
</p>


 
<li>In the following example, %NUM is set to 3:
In the following example
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M')
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'B')
</p>
</p>
%NUM is set to 2.


In the following example
<li>In the following example, %NUM is set to 4:
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'M')
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU')
</p>
</p>
%NUM is set to 3.


In the following example
<li>In the following example, %NUM is set to 1:
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MU')
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP')
</p>
</p>
%NUM is set to 4.


In the following example
<li>In the following example, %NUM is set to 0:
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'TOP')
<p class="code">%NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD')</p>
</p>
</ol>
%NUM is set to 1.


In the following example
==Products authorizing {{PAGENAMEE}}==
<p class="code"> %NUM = $Abbrev('TOP BOTTOM MIDDLE MUDDLE', 'MAD')
<ul class="smallAndTightList">
</p>
<li>[[List of $functions|Sirius functions]]</li>
%NUM is set to 0.
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $Abbrev
</p>


[[Category:$Functions|$Abbrev]]
[[Category:$Functions|$Abbrev]]

Latest revision as of 22:51, 20 September 2018

Determine if string is abbreviation within list of words

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is currently no direct OO equivalent for $Abbrev. However, the IsStartOf function can be used to determine whether one string is an initial substring (abbreviation) of another.

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

Syntax

%result = $Abbrev(word_list, string)

Syntax terms

%result A numeric value that indicates the relative position in word_list of the first word for which string is a valid abbreviation.
word_list A list of blank-delimited words.
string The word to be compared with the word_list argument.

Return codes

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

Examples

  1. In the following example, %NUM is set to 2:

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

  2. In the following example, %NUM is set to 3:

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

  3. In the following example, %NUM is set to 4:

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

  4. In the following example, %NUM is set to 1:

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

  5. In the following example, %NUM is set to 0:

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

Products authorizing $Abbrev