$Web Selps Check: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Check parameters against a delimited list of strings<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Check parameters against a delimited list of strings<section end="desc" /></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_SELx functions, it is not really restricted to select options list processing. An overview of the $WEB_SEL_x functions is provided in [[$Web_Selp]].  
$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 <var class="product">User Language</var> request is cancelled.
$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.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Web_Selps_Check(delimited_strings, param_name, -
<p class="syntax"><section begin="syntax" />%rc = $Web_Selps_Check(delimited_strings, param_name, [option_keywords])
option_keywords)
<section end="syntax" /></p>
<section end="syntax" /></p>


===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>delimited_strings</th>
<tr><th>delimited_strings</th>
Line 16: Line 17:
<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>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 class="syntaxTable">
<table class="syntaxTable">
<tr><th>CANCHECK</th>
<tr><th>CANCHECK</th>
Line 27: Line 28:
<td>Synonym for NOISINDEX
<td>Synonym for NOISINDEX
</td></tr></table>
</td></tr></table>
This an optional argument.
</td></tr></table>
</td></tr></table>


===Return codes===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>Code</th>
<tr><th>Code</th>
Line 39: Line 40:
global select element ''global_name'', and CANCHECK option not specified.<tr><th></th>
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>
==Usage notes==
<p class="caption">$WEB_SELPS_CHECK return codes</p>
<ul>
<li>See [[$Web_Selp]] for an extended example using other $WEB_SELx functions.
 
<li>$Web_Selps_Check and $Web_Selsp_Check are synonyms.
</ul>


For example, the following statement will cancel the <var class="product">User Language</var> request if the value of the form parameter <tt>DN</tt> is not one of the strings<tt>DN0</tt>, <tt>DN1</tt>, etc.:
==Examples==
The following statement will cancel the <var class="product">User Language</var> request if the value of the form parameter <tt>DN</tt> is not one of the strings<tt>DN0</tt>, <tt>DN1</tt>, etc.:


<p class="code"> %RC = $Web_Selsp_Check('/DN0/DN1/DN2' -
<p class="code">%rc = $Web_Selsp_Check('/DN0/DN1/DN2' -
              WITH '/DN3/DN4/DN5/DN6', -
              WITH '/DN3/DN4/DN5/DN6', -
              'DN', 'CANCHECK')
              'DN', 'CANCHECK')
</p>
</p>


See [[$Web_Selp]] for an extended example using other $WEB_SELx functions.
$Web_Selps_Check and $Web_Selsp_Check are synonyms.


[[Category:Janus Web Server $functions|$Web_Selps_Check]]
[[Category:Janus Web Server $functions|$Web_Selps_Check]]

Revision as of 16:30, 15 June 2012

<section begin="desc" />Check parameters against a delimited list of strings<section end="desc" />

$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

<section begin="syntax" />%rc = $Web_Selps_Check(delimited_strings, param_name, [option_keywords]) <section end="syntax" />

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:
CANCHECK Cancel request if any value of param_name not found in select options list
NOFORM Don't look in form parameters
NOISINDEX Don't look in isindex parameters
NOISI Synonym for NOISINDEX

Return codes

global select element global_name. global select element global_name, and CANCHECK option not specified.
Code Meaning
0 Selected_value equal to one of the values in
2 Selected_value not equal to any of the values in
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')