$Web IsIndex Parm Num Line: Difference between revisions
m (1 revision) |
(Automatically generated page update) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_IsIndex_Parm_Num_Line}} | {{DISPLAYTITLE:$Web_IsIndex_Parm_Num_Line}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Number of isindex field lines</span> | ||
$Web_IsIndex_Parm_Num_Line retrieves the number of lines in an isindex field. It is especially useful for ''textarea'' input fields. | <var>$Web_IsIndex_Parm_Num_Line</var> retrieves the number of lines in an isindex field. It is especially useful for ''textarea'' input fields. | ||
$Web_IsIndex_Num_Line is a short synonym for $Web_IsIndex_Parm_Num_Line. | <var>$Web_IsIndex_Num_Line</var> is a short synonym for <var>[[$Web_IsIndex_Parm_Num_Line]]</var>. | ||
Since isindex fields are more commonly called "URL parameters," you can use another synonym for this $function, <var>[[$Web_URL_Parm_Num_Line]]</var>. | |||
<var>$Web_IsIndex_Parm_Num_Line</var> takes two arguments and returns either the number of lines in the isindex field or a 0 indicating either that there were no lines in the isindex field or that some other error has occurred. Possible errors would be the isindex field not being found or the function being invoked on a non-web server thread. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%string</span> = <span class="literal">$Web_isIndex_Parm_Num_Line</span>( <span class="term">fieldname</span>, <span class="term">occurrence</span> ) | ||
</p> | |||
< | |||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fieldname</th> | <tr><th>fieldname</th> | ||
<td>The name of the isindex field, returned by $Web_IsIndex_Name. Required argument if occurrence not specified, otherwise optional.</td></tr> | <td>The name of the isindex field, returned by <var>[[$Web_IsIndex_Name]]</var>. Required argument if occurrence not specified, otherwise optional.</td></tr> | ||
<tr><th>occurrence</th> | <tr><th>occurrence</th> | ||
<td>The occurrence number of a isindex field, or the occurrence number of the isindex field matching | <td>The occurrence number of a isindex field, or the occurrence number of the isindex field matching <var class="term">fieldname</var>, if <var class="term">fieldname</var> is specified. Optional argument if <var class="term">fieldname</var> is specified, otherwise it is required. | ||
</td></tr></table> | </td></tr></table> | ||
==Usage notes== | |||
<ul> | |||
<li>A line is considered to be a block of text that is terminated by either an ASCII carriage return (X'0D') or a carriage return followed by a line feed (X'0A'). This is what is ordinarily sent by a browser to mark the end of each line of a textarea input field. | |||
<li>For a discussion of isindex requests and data, see [[Janus Web Server application coding considerations#URL parameters or isindex data|"URL parameters or isindex data"]]. | |||
</ul> | |||
==Examples== | |||
This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea. | This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea. | ||
<p class="code"> | <p class="code">%LINES = $Web_IsIndex_Parm_Num_Line('COMMENTS') | ||
IF %LINES GT %MAXLINES THEN | |||
AUDIT 'Maximum lines exceeded for ' WITH - | |||
$Web_Hdr_Parm('URL') WITH ' - input will be truncated' | |||
%LINES = %MAXLINES | |||
END IF | |||
</p> | </p> | ||
Line 48: | Line 50: | ||
<li><var>[[$Web_IsIndex_Parm]]</var> | <li><var>[[$Web_IsIndex_Parm]]</var> | ||
</ul> | </ul> | ||
[[Category:Janus Web Server $functions|$Web_IsIndex_Parm_Num_Line]] | [[Category:Janus Web Server $functions|$Web_IsIndex_Parm_Num_Line]] |
Latest revision as of 02:03, 16 April 2013
Number of isindex field lines
$Web_IsIndex_Parm_Num_Line retrieves the number of lines in an isindex field. It is especially useful for textarea input fields.
$Web_IsIndex_Num_Line is a short synonym for $Web_IsIndex_Parm_Num_Line.
Since isindex fields are more commonly called "URL parameters," you can use another synonym for this $function, $Web_URL_Parm_Num_Line.
$Web_IsIndex_Parm_Num_Line takes two arguments and returns either the number of lines in the isindex field or a 0 indicating either that there were no lines in the isindex field or that some other error has occurred. Possible errors would be the isindex field not being found or the function being invoked on a non-web server thread.
Syntax
%string = $Web_isIndex_Parm_Num_Line( fieldname, occurrence )
Syntax terms
fieldname | The name of the isindex field, returned by $Web_IsIndex_Name. Required argument if occurrence not specified, otherwise optional. |
---|---|
occurrence | The occurrence number of a isindex field, or the occurrence number of the isindex field matching fieldname, if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required. |
Usage notes
- A line is considered to be a block of text that is terminated by either an ASCII carriage return (X'0D') or a carriage return followed by a line feed (X'0A'). This is what is ordinarily sent by a browser to mark the end of each line of a textarea input field.
- For a discussion of isindex requests and data, see "URL parameters or isindex data".
Examples
This example checks if the number of lines returned in a textarea exceeds the size of the array meant to hold the input from the textarea.
%LINES = $Web_IsIndex_Parm_Num_Line('COMMENTS') IF %LINES GT %MAXLINES THEN AUDIT 'Maximum lines exceeded for ' WITH - $Web_Hdr_Parm('URL') WITH ' - input will be truncated' %LINES = %MAXLINES END IF