$Web Selps Check: Difference between revisions
m (1 revision) |
mNo edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Selps_Check}} | {{DISPLAYTITLE:$Web_Selps_Check}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Check parameters against a delimited list of strings</span> | ||
$Web_Selps_Check validates that each value of a form and/or isindex parameter 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 not really restricted to select options list processing. An overview of the $Web_Sel* functions is provided in [[$Web_Selp]]. | <var>$Web_Selps_Check</var> validates that each value of a form and/or isindex parameter 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 not really restricted to select options list processing. An overview of the $Web_Sel* functions is provided in [[$Web_Selp]]. | ||
$Web_Selps_Check takes three arguments and returns a numeric result code; for some types of errors, the current <var class="product">User Language</var> request is cancelled. | <var>$Web_Selps_Check</var> takes three arguments and returns a numeric result code; for some types of errors, the current <var class="product">User Language</var> request is cancelled. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Selps_Check</span>(<span class="term">delimited_strings</span>, <span class="term">param_name</span>, [<span class="term">option_keywords</span>]) | ||
< | </p> | ||
===Syntax terms=== | ===Syntax terms=== | ||
Line 14: | Line 14: | ||
<tr><th>delimited_strings</th> | <tr><th>delimited_strings</th> | ||
<td>A string containing a delimited list of strings which are used to check the values of the parameter. 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. This is a required argument.</td></tr> | <td>A string containing a delimited list of strings which are used to check the values of the parameter. 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. This is a required argument.</td></tr> | ||
<tr><th>param_name</th> | <tr><th>param_name</th> | ||
<td>The name of a form and/or an index parameter in the current web request. For each occurrence of this parameter, its value is checked to see if it is equal to one of the strings in the delimited list. This a required argument.</td></tr> | <td>The name of a form and/or an index parameter in the current web request. For each occurrence of this parameter, its value is checked to see if it is equal to one of the strings in the delimited list. This a required argument.</td></tr> | ||
<tr><th>option_keywords</th> | <tr><th>option_keywords</th> | ||
<td>This optional argument is a string of blank-separated keywords specifying special processing for this $function; it can contain any of the following: | <td>This optional argument is a string of blank-separated keywords specifying special processing for this $function; it can contain any of the following: | ||
<table | <table> | ||
<tr><th>CANCHECK</th> | <tr><th><var>CANCHECK</var></th> | ||
<td>Cancel request if any value of | <td>Cancel request if any value of <var class="term">param_name</var> not found in select options list</td></tr> | ||
<tr><th>NOFORM</th> | |||
<tr><th><var>NOFORM</var></th> | |||
<td>Don't look in form parameters</td></tr> | <td>Don't look in form parameters</td></tr> | ||
<tr><th>NOISINDEX</th> | |||
<tr><th><var>NOISINDEX</var></th> | |||
<td>Don't look in isindex parameters</td></tr> | <td>Don't look in isindex parameters</td></tr> | ||
<tr><th>NOISI</th> | |||
<td>Synonym for NOISINDEX | <tr><th><var>NOISI</var></th> | ||
<td>Synonym for <var>NOISINDEX</var> | |||
</td></tr></table> | </td></tr></table> | ||
</td></tr></table> | </td></tr></table> | ||
===Return codes=== | ===Return codes=== | ||
<table | <table> | ||
<tr><th>Code</th> | <tr><th>Code</th> | ||
<th>Meaning</th></tr> | <th>Meaning</th></tr> | ||
<tr>< | <tr><td>0</td> | ||
<td>''Selected_value'' equal to one of the values in | <td>''Selected_value'' equal to one of the values in global select element ''global_name''. | ||
global select element ''global_name''.<tr>< | |||
<td>''Selected_value'' not equal to any of the values in | <tr><td>2</td> | ||
global select element ''global_name'', and CANCHECK option not specified.<tr><th></th> | <td>''Selected_value'' not equal to any of the values in global select element ''global_name'', and CANCHECK option not specified. | ||
<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> | ||
</table> | </table> | ||
Line 44: | Line 51: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>See [[$Web_Selp]] for an extended example using other $WEB_SELx functions. | <li>See <var>[[$Web_Selp]]</var> for an extended example using other $WEB_SELx functions. | ||
<li>$Web_Selps_Check and <var>$Web_Selsp_Check</var> are synonyms. | <li><var>$Web_Selps_Check</var> and <var>$Web_Selsp_Check</var> are synonyms. | ||
</ul> | </ul> | ||
Line 56: | Line 63: | ||
'DN', 'CANCHECK') | 'DN', 'CANCHECK') | ||
</p> | </p> | ||
[[Category:Janus Web Server $functions|$Web_Selps_Check]] | [[Category:Janus Web Server $functions|$Web_Selps_Check]] |
Latest revision as of 17:06, 16 April 2013
Check parameters against a delimited list of strings
$Web_Selps_Check validates that each value of a form and/or isindex parameter 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 not really restricted to select options list processing. An overview of the $Web_Sel* functions is provided in $Web_Selp.
$Web_Selps_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_Selps_Check(delimited_strings, param_name, [option_keywords])
Syntax terms
delimited_strings | A string containing a delimited list of strings which are used to check the values of the parameter. 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. This is a required argument. | ||||||||
---|---|---|---|---|---|---|---|---|---|
param_name | The name of a form and/or an index parameter in the current web request. For each occurrence of this parameter, its value is checked to see if it is equal to one of the strings in the delimited list. This a required argument. | ||||||||
option_keywords | This optional argument is 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 values in global select element global_name. |
2 | Selected_value not equal to any of the values in global select element global_name, and CANCHECK option not specified. |
Any other error results in cancellation of the User Language request. |
Usage notes
- See $Web_Selp for an extended example using other $WEB_SELx functions.
- $Web_Selps_Check and $Web_Selsp_Check are synonyms.
Examples
The following statement will cancel the User Language request if the value of the form parameter DN is not one of the stringsDN0, DN1, etc.:
%rc = $Web_Selsp_Check('/DN0/DN1/DN2' - WITH '/DN3/DN4/DN5/DN6', - 'DN', 'CANCHECK')