$Sir Wild: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(39 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Test string against a wildcard string</span>
<span class="pageSubtitle">Test string against a wildcard string</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Sir_Wild function is the [[RegexMatch (String function)]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Sir_Wild function is the <var>[[RegexMatch (String function)|RegexMatch]]</var> function.</p>


$Sir_Wild indicates whether the one string matches a Sirius-style pattern where a "*" matches any set of characters, a "?" matches any single character and a """ indicates that the following character is to be treated as a literal even if it is one of the three special wildcard characters, that is "*", "?" or """. $Sir_Wild takes two string arguments and returns either a 0 or 1.  
<var>$Sir_Wild</var> indicates whether the one string matches a Sirius-style pattern where asterisk (<tt>*</tt>) matches any set of characters, question mark (<tt>?</tt>) matches any single character, and double-quotation mark (<tt>"</tt>) indicates that the following character is to be treated as a literal even if it is one of the three special wildcard characters: <code>* ? "</code>. <var>$Sir_Wild</var> takes two string arguments and returns either a 0 or 1.  


The first argument is the string to be tested for a match. This is an optional argument and defaults to null.  
The first argument is the string to be tested for a match. This is an optional argument and defaults to null.  
Line 11: Line 11:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Sir_Wild(string, wildcard)
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Sir_Wild</span>([<span class="term">string</span>], [<span class="term">wildcard</span>])
<section end="syntax" /></p>
<p class="caption">$Sir_Wild Function
</p>
</p>
<p class="caption"> %RC is set to 0 or 1.</p>


$Sir_Wild returns either a 1 indicating that the first string matches the second or 0 otherwise. For example, this returns 1:
<var class="term">%rc</var> is set to 0 or 1.
 
==Examples==
<var>$Sir_Wild</var> returns either a 1 indicating that the first string matches the second or 0 otherwise. For example, this returns 1:


<p class="code"> $Sir_Wild('Ahab', 'A*')
<p class="code"> $Sir_Wild('Ahab', 'A*')
Line 32: Line 32:
</p>
</p>


$Sir_Wild is new in Version 6.3 of the ''[[Sirius Mods]]''.
==Products authorizing {{PAGENAMEE}}==
 
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|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 $Sir_Wild
</p>


[[Category:$Functions|$Sir_Wild]]
[[Category:$Functions|$Sir_Wild]]

Latest revision as of 23:27, 20 September 2018

Test string against a wildcard string

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Sir_Wild function is the RegexMatch function.

$Sir_Wild indicates whether the one string matches a Sirius-style pattern where asterisk (*) matches any set of characters, question mark (?) matches any single character, and double-quotation mark (") indicates that the following character is to be treated as a literal even if it is one of the three special wildcard characters: * ? ". $Sir_Wild takes two string arguments and returns either a 0 or 1.

The first argument is the string to be tested for a match. This is an optional argument and defaults to null.

The second argument is the string, possibly containing wildcards, against which the first argument is to be tested. This is an optional argument and defaults to null.

Syntax

%rc = $Sir_Wild([string], [wildcard])

%rc is set to 0 or 1.

Examples

$Sir_Wild returns either a 1 indicating that the first string matches the second or 0 otherwise. For example, this returns 1:

$Sir_Wild('Ahab', 'A*')

This returns 0:

$Sir_Wild('Starbuck', 'A*')

This returns 1:

$Sir_Wild('*LOOK', '"*LOO?')

Products authorizing $Sir_Wild