$Web Sel Check: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Sel_Check}}
{{DISPLAYTITLE:$Web_Sel_Check}}
<span class="pageSubtitle"><section begin="desc" />Check string against a global select element<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Check string against a global select element<section end="desc" /></span>


$Web_Sel_Check validates that a string matches one of the options of a global select element. An overview of the $WEB_SEL_x functions is provided in [[$Web_Selp]].  
$Web_Sel_Check validates that a string matches one of the options of a global select element. An overview of the $WEB_SEL_x functions is provided in [[$Web_Selp]].  
Line 8: Line 6:
$Web_Sel_Check takes three arguments and returns a numeric result code; for some types of errors, the current User Language request is cancelled.
$Web_Sel_Check takes three arguments and returns a numeric result code; for some types of errors, the current User Language request is cancelled.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Web_Sel_Check(global_name, selected_value, -
<p class="syntax"><section begin="syntax" /> %RC = $Web_Sel_Check(global_name, selected_value, option_keywords)
option_keywords)
<section end="syntax" /></p>
<section end="syntax" /></p>


<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>global_name</th>
<tr><th>global_name</th>
<td>The name of the global select element containing the values to check against. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.</td></tr>
<td>The name of the global select element containing the values to check against. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.</td></tr>
<tr><th>selected_value</th>
<tr><th>selected_value</th>
<td>A string which is checked to see if it is equal to one of the values in the options list. This a required argument.</td></tr>
<td>A string which is checked to see if it is equal to one of the values in the options 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. Any of the following is valid:
<table class="syntaxTable">
<table class="syntaxTable">
<td>A string of blank-separated keywords specifying special processing for this $function. Any of the following is valid:</td></tr>
<tr><th>CANCHECK</th>
<tr><th>CANCHECK</th>
<td>Cancel request if ''selected_value'' not found in select options list</td></tr>
<td>Cancel request if ''selected_value'' not found in select options list</td></tr>
Line 32: Line 22:
<td>Don't cancel request if global select element ''global_name'' not found
<td>Don't cancel request if global select element ''global_name'' not found
</td></tr></table>
</td></tr></table>
This an optional argument.
This an optional argument.
</td></tr></table>
</td></tr></table>
Line 41: Line 29:
<td>Meaning</td></tr>
<td>Meaning</td></tr>
<tr><th>0</th>
<tr><th>0</th>
<td>''Selected_value'' equal to one of the values in</td>
<td>''Selected_value'' equal to one of the values in global select element ''global_name''.</td></tr>
global select element ''global_name''.<tr><th>1</th>
<tr><th>1</th>
<td>''Global_name'' not a saved global select element, and NOCAN option</td>
<td>''Global_name'' not a saved global select element, and NOCAN option specified.</td></tr>
specified.<tr><th>2</th>
<tr><th>2</th>
<td>''Selected_value'' not equal to any of the values in</td>
<td>''Selected_value'' not equal to any of the values in global select element ''global_name'', and CANCHECK option not specified.</td></tr>
global select element ''global_name'', and CANCHECK option not specified.<tr><th></th>
<tr><th></th>
<td>Any other error results in cancellation of the User Language request.</td></tr>
<td>Any other error results in cancellation of the User Language request.</td></tr>
</table>
</table>
<p class="caption">$WEB_SEL_CHECK return codes</p>
<p class="caption">$WEB_SEL_CHECK return codes</p>


The following statement will cancel the User Language request if the string 'DAY6' is not one of the values of the global select element 'DAYS.ESPERANTO':


 
<p class="code"> %RC = $Web_Sel_Check('DAYS.ESPERANTO', 'DN6', 'CANCHECK')
The following statement will cancel the User Language request if the string 'DAY6' is not one of the values of the global select element 'DAYS.ESPERANTO':
<p class="code"> %RC = $Web_Sel_Check('DAYS.ESPERANTO', -
'DN6', 'CANCHECK')
</p>
</p>


See [[$Web_Selp]] for an extended example using other $WEB_SELx functions.
See [[$Web_Selp]] for an extended example using other $WEB_SELx functions.


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

Revision as of 21:42, 22 February 2011

<section begin="desc" />Check string against a global select element<section end="desc" />

$Web_Sel_Check validates that a string matches one of the options of a global select element. An overview of the $WEB_SEL_x functions is provided in $Web_Selp.

$Web_Sel_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_Sel_Check(global_name, selected_value, option_keywords) <section end="syntax" />

global_name The name of the global select element containing the values to check against. The global select element with this name must have been created by $Web_Save_Sel. This is a required argument.
selected_value A string which is checked to see if it is equal to one of the values in the options list. This a required argument.
option_keywords A string of blank-separated keywords specifying special processing for this $function. Any of the following is valid:
CANCHECK Cancel request if selected_value not found in select options list
NOCAN Don't cancel request if global select element global_name not found

This an optional argument.

Code Meaning
0 Selected_value equal to one of the values in global select element global_name.
1 Global_name not a saved global select element, and NOCAN option specified.
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.

$WEB_SEL_CHECK return codes

The following statement will cancel the User Language request if the string 'DAY6' is not one of the values of the global select element 'DAYS.ESPERANTO':

%RC = $Web_Sel_Check('DAYS.ESPERANTO', 'DN6', 'CANCHECK')

See $Web_Selp for an extended example using other $WEB_SELx functions.