$Web Parm Line: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (→Syntax) |
||
(26 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Parm_Line}} | {{DISPLAYTITLE:$Web_Parm_Line}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Value of isindex or form field line</span> | ||
<var>$Web_Parm_Line</var> retrieves the value of a specific line in an isindex or form field. It is especially useful for ''textarea'' input fields. <var>$Web_Line</var> is a short synonym for <var>$Web_Parm_Line</var>. | |||
<var>$Web_Parm_Line</var> takes three arguments and returns a string, or null for any error condition. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%string</span> = $Web_[Parm_]Line( <span class="term">fieldname, occurrence</span>, [<span class="term">line_num</span>] ) | ||
</p> | |||
< | |||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fieldname</th> | <tr><th>fieldname</th> | ||
<td>The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional.</td></tr> | <td>The name of the isindex or form field, returned by <var>[[$Web_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 an isindex or form field, or the occurrence number of the isindex or form field matching | <td>The occurrence number of an isindex or form field, or the occurrence number of the isindex or form 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> | ||
<tr><th>line_num</th> | <tr><th>line_num</th> | ||
<td>Line number in the isindex or form field for which data is to be returned. This is an optional argument and defaults to 1. | <td>Line number in the isindex or form field for which data is to be returned. This is an optional argument and defaults to 1. | ||
</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><var>$Web_Parm_Num_Line</var> first looks for isindex fields matching the name, then for matching form fields. <var>$Web_Parm_Num_Line</var> can be used instead of <var>$Web_IsIndex_Parm_Num_Line</var> and <var>[[$Web_Form_Parm_Num_Line]]</var> to make it easy to switch between using "method=GET" and "method=POST" <code><form></code> tags and simply to save typing. | |||
<li>For a discussion of isindex or form requests and data, see [[Janus Web Server application coding considerations#URL parameters or isindex data|"URL parameters or isindex data"]]. | |||
</ul> | |||
==Examples== | |||
This example places each line of a textarea isindex or form field into an occurrence of a multiply occurring field. | This example places each line of a textarea isindex or form field into an occurrence of a multiply occurring field. | ||
<p class="code"> FOR 1 RECORD IN ORDER_RECORD | <p class="code">FOR 1 RECORD IN ORDER_RECORD | ||
FOR %I FROM 1 TO $Web_Num_Line('COMMENTS') | |||
%COMMENT = $Web_Line('COMMENTS', , %I) | |||
ADD COMMENT = %COMMENT | |||
END FOR | |||
END FOR | |||
</p> | </p> | ||
==See also== | |||
See also | |||
<ul> | <ul> | ||
<li><var>[[$Web_Parm_Len]]</var> | |||
<li>[[$Web_Parm_Len]] | <li><var>[[$Web_Name]]</var> | ||
<li>[[$Web_Name]] | <li><var>[[$Web_Parm]]</var> | ||
<li>[[$Web_Parm]] | <li><var>[[$Web_Num]]</var> | ||
<li>[[$Web_Num]] | <li><var>[[$Web_Parm_Num_Line]]</var> | ||
<li>[[$Web_Parm_Num_Line]] | <li><var>[[$Web_Form_Parm_Len]]</var> | ||
<li>[[$Web_Form_Parm_Len]] | <li><var>[[$Web_IsIndex_Parm_Line]]</var> | ||
<li>[[$Web_IsIndex_Parm_Line]] | |||
</ul> | </ul> | ||
[[Category:Janus Web Server $functions|$Web_Parm_Line]] | [[Category:Janus Web Server $functions|$Web_Parm_Line]] |
Latest revision as of 22:05, 5 June 2013
Value of isindex or form field line
$Web_Parm_Line retrieves the value of a specific line in an isindex or form field. It is especially useful for textarea input fields. $Web_Line is a short synonym for $Web_Parm_Line.
$Web_Parm_Line takes three arguments and returns a string, or null for any error condition.
Syntax
%string = $Web_[Parm_]Line( fieldname, occurrence, [line_num] )
Syntax terms
fieldname | The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional. |
---|---|
occurrence | The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching fieldname, if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required. |
line_num | Line number in the isindex or form field for which data is to be returned. This is an optional argument and defaults to 1. |
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.
- $Web_Parm_Num_Line first looks for isindex fields matching the name, then for matching form fields. $Web_Parm_Num_Line can be used instead of $Web_IsIndex_Parm_Num_Line and $Web_Form_Parm_Num_Line to make it easy to switch between using "method=GET" and "method=POST"
<form>
tags and simply to save typing. - For a discussion of isindex or form requests and data, see "URL parameters or isindex data".
Examples
This example places each line of a textarea isindex or form field into an occurrence of a multiply occurring field.
FOR 1 RECORD IN ORDER_RECORD FOR %I FROM 1 TO $Web_Num_Line('COMMENTS') %COMMENT = $Web_Line('COMMENTS', , %I) ADD COMMENT = %COMMENT END FOR END FOR