$Web Sel Check: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Example) |
||
(21 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Sel_Check}} | {{DISPLAYTITLE:$Web_Sel_Check}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Check string against a global select element</span> | ||
$Web_Sel_Check validates that a string matches one of the options of a global select element. An overview of the $ | <var>$Web_Sel_Check</var> validates that a string matches one of the options of a global select element. An overview of the $Web_Sel* functions is provided in <var>[[$Web_Selp]]</var>. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Sel_Check</span>(<span class="term">global_name</span>, <span class="term">selected_value</span>, <span class="term">option_keywords</span>) | ||
< | </p> | ||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%rc</th> | |||
<td>a numeric result code; for some types of errors, the current <var class="product">User Language</var> request is cancelled.</td></tr> | |||
<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 <var>$Web_Save_Sel</var>. 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: | <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"> | ||
<tr><th>CANCHECK</th> | |||
<tr><th><var>CANCHECK</var></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> | ||
<tr><th>NOCAN</th> | |||
<tr><th><var>NOCAN</var></th> | |||
<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> | ||
Line 25: | Line 32: | ||
</td></tr></table> | </td></tr></table> | ||
<table | ===$Web_Sel_Check return codes=== | ||
<table> | |||
<tr><th>Code</th> | <tr><th>Code</th> | ||
< | <th>Meaning</th></tr> | ||
<tr><th>0</th> | <tr><th>0</th> | ||
<td>''Selected_value'' equal to one of the values in global select element ''global_name''.</td></tr> | <td>''Selected_value'' equal to one of the values in global select element ''global_name''.</td></tr> | ||
Line 35: | Line 43: | ||
<td>''Selected_value'' not equal to any of the values in global select element ''global_name'', and CANCHECK option not specified.</td></tr> | <td>''Selected_value'' not equal to any of the values in global select element ''global_name'', and CANCHECK option not specified.</td></tr> | ||
<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 <var class="product">User Language</var> request.</td></tr> | ||
</table> | </table> | ||
The following statement will cancel the User Language request if the string | ==Examples== | ||
<ol> | |||
<li>The following statement will cancel the <var class="product">User Language</var> request if the string <code>DAY6</code> is not one of the values of the global select element <code>DAYS.ESPERANTO</code>: | |||
<p class="code"> % | <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. | <li>See [[$Web_Selp]] for an extended example using other $WEB_SELx functions. | ||
</ol> | |||
[[Category:Janus Web Server $functions|$Web_Sel_Check]] | [[Category:Janus Web Server $functions|$Web_Sel_Check]] |
Latest revision as of 22:35, 12 April 2013
Check string against a global select element
$Web_Sel_Check validates that a string matches one of the options of a global select element. An overview of the $Web_Sel* functions is provided in $Web_Selp.
Syntax
%rc = $Web_Sel_Check(global_name, selected_value, option_keywords)
Syntax terms
%rc | a numeric result code; for some types of errors, the current User Language request is cancelled. | ||||
---|---|---|---|---|---|
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:
This an optional argument. |
$Web_Sel_Check return codes
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. |
Examples
- The following statement will cancel the User Language request if the string
DAY6
is not one of the values of the global select elementDAYS.ESPERANTO
:%rc = $Web_Sel_Check('DAYS.ESPERANTO', 'DN6', 'CANCHECK')
- See $Web_Selp for an extended example using other $WEB_SELx functions.