$Web Sels Check: Difference between revisions
Jump to navigation
Jump to search
m (→Return codes) |
m (→Syntax) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Sels_Check</span>(<span class="term">delimited_strings</span>, <span class="term">selected_value</span>, [<span class="term">option_keywords</span>]) | <p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Sels_Check</span>(<span class="term">delimited_strings</span>, [<span class="term">selected_value</span>], [<span class="term">option_keywords</span>]) | ||
</p> | </p> | ||
Line 25: | Line 25: | ||
===Return codes=== | ===Return codes=== | ||
<table | <table> | ||
<tr><th>Code</th> | <tr><th>Code</th> | ||
<th>Meaning</th></tr> | <th>Meaning</th></tr> | ||
<tr><td>0</td> | <tr><td>0</td> | ||
<td> | <td><var class="term">selected_value</var> equal to one of the delimited strings.</td></tr> | ||
< | |||
tr><td>2</td> | <tr><td>2</td> | ||
<td> | <td><var class="term">selected_value</var> not equal to any of the delimited strings, and <var>CANCHECK</var> option not specified.</td></tr> | ||
<tr><th></th> | <tr><th></th> | ||
<td>Any other error results in cancellation of the <var class="product">User Language</var> request.</td></tr> | <td>Any other error results in cancellation of the <var class="product">User Language</var> request.</td></tr> |
Latest revision as of 17:15, 16 April 2013
Check string against a delimited list of strings
$Web_Sels_Check validates that a string matches one of a delimited list of strings. Note that although this is provided for a sort of symmetry in the $Web_Sel* functions, it is somewhat unnecessary; a simple $Oneof could do basically the same thing. An overview of the $Web_Sel* functions is provided in $Web_Selp.
$Web_Sels_Check takes three arguments and returns a numeric result code; for some types of errors, the current User Language request is cancelled.
Syntax
%rc = $Web_Sels_Check(delimited_strings, [selected_value], [option_keywords])
Syntax terms
delimited_strings | A string containing a delimited list of strings which are used to check the string. The first character of this argument is the delimiter that separates the values. The string should not contain a trailing delimiter unless one of the values is the null string, which is unlikely, at least when used with select option lists. This is a required argument. | ||
---|---|---|---|
selected_value | This optional argument is a string which is checked to see if it is equal to one of the delimited strings. This a required argument. | ||
option_keywords | A string of blank-separated keywords specifying special processing for this $function; it can contain any of the following:
|
Return codes
Code | Meaning |
---|---|
0 | selected_value equal to one of the delimited strings. |
2 | selected_value not equal to any of the delimited strings, and CANCHECK option not specified. |
Any other error results in cancellation of the User Language request. |
Examples
- The following statement will cancel the User Language request if the value of variable %SEL is not one of the stringsDN0, DN1, etc.:
%RC = $Web_Sels_Check('/DN0/DN1/DN2/DN3/DN4' - WITH '/DN5/DN6', %SEL, 'CANCHECK')
- See $Web_Selp for an extended example using other $Web_Sel* functions.