Jive processes a special HTML page containing embedded Jive commands. It takes HTML Form Input from the previous HTML page and passes it to the embedded Jive code. The embedded Jive code is replaced with HTML text output by the code. The constructed HTML page is the output from Jive.
The Jive Interpreter scans the input HTML page, passing all characters to HTML output until it encounters a left brace ({) or a reverse slash (\). The left brace begins a set of embedded Jive code. The reverse slash is ignored unless it occurs at the end of a line. A reverse slash at the end of a line suppresses the following new-line; the new-line and the reverse slash are not sent to HTML output.
When a left brace is encountered in HTML text, the next character is examined. If it is a second left brace, a single brace is output to HTML. Two consecutive left braces are used when an actual left brace is needed in HTML output.
If the left brace is followed by an asterix (*), it begins a Jive comment. Comments begin with {* and are terminated with *}. All text within comments is suppressed. See Jive Comments for examples.
If the left brace is not followed by another left brace or an asterix, it begins a set of Jive code. The Jive code is terminated by a right brace (}).
Note: {* Comments can be used in embedded Jive code also. *}
The simplest Jive command is an expression. The value of the expression is output to the HTML page. For example,
Today, we have {invoice_count} invoices.
In the second example, if is used for more effective presentation,
Today, we have {if (invoice_count=0) 'no' else invoice_count} invoices.
{if search_count > 50}\
<p>
Note: Over fifty items were found by the search criteria. It is usually
best in these circumstances to narrow your search criteria.
{end}\
The SQL select command processes a segment of HTML text for each
row in the result set. For example, the following displays a bullet
list of items:
{input type}\
<h3>Items:</h3>
<ul>
{select name from items where type = :type}\
<li>{name}
{end}\
</ul>