📄 manual.html
字号:
<I>...case statements...</I>
</blockquote>
<% <B>default</B>: %><BR>
<blockquote>
<I>...default statements...</I>
</blockquote>
</blockquote>
<% <B>endswitch</B>; %><BR>
</blockquote>
<BR>
</LI>
<LI>
<H4>Loop statement:</H4>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>while</B> ( <I>condition</I> )<BR>
{<BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
}<BR>
</blockquote>
The loop statements are executed while condition is <I>TRUE</I>.<BR>
<BR>
There's an optional syntax in TAG format:<BR>
<blockquote style="background-color:#CDCDCD;">
<% <B>while</B> ( <I>condition</I> )<B>:</B> %><BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
<% <B>endwhile</B>; %><BR>
</blockquote>
<BR>
</LI>
<LI>
<H4>Array scan statement:</H4>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>foreach</B> ( <I>arrayname</I> <B>as</B> <I>varname</I> )<BR>
{<BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
}<BR>
</blockquote>
The loop statements are executed for every value present in array.<BR>
<BR>
There's an optional syntax in TAG format:<BR>
<blockquote style="background-color:#CDCDCD;">
<% <B>foreach</B> ( <I>arrayname</I> <B>as</B> <I>varname</I> )<B>:</B> %><BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
<% <B>endforeach</B>; %><BR>
</blockquote>
<BR>
</LI>
<LI>
<H4>Set scan statement:</H4>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>foreach</B> ( <I>setname</I> <B>as</B> <I>varname1</I>, <I>varname2</I>, ..., <I>varnameN</I> )<BR>
{<BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
}<BR>
</blockquote>
The loop statements are executed for every result set.<BR>
Every field of the result set will be represented by the local n-variable.<BR>
<BR>
There's an optional syntax in TAG format:<BR>
<blockquote style="background-color:#CDCDCD;">
<% <B>foreach</B> ( <I>setname</I> <B>as</B> <I>varname1</I>, <I>varname2</I>, ..., <I>varnameN</I> )<B>:</B> %><BR>
<blockquote>
<I>...loop statements...</I>
</blockquote>
<% <B>endforeach</B>; %><BR>
</blockquote>
<BR>
</LI>
<LI>
<H4>Breacking a block statement:</H4>
<BR>
The <I>break</I> keyword will exit from the inner loop statements or from the case block statements:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>break</B>;<BR>
</blockquote>
<BR>
</LI>
<LI>
<H4>Transaction statement:</H4>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>transaction</B><BR>
{<BR>
<blockquote>
<I>...database access statements...</I>
</blockquote>
}<BR>
</blockquote>
The database access statements are executed like a single transaction (when supported by the driver).<BR>
<B>break</B> instructions inner transactions statements are not allowed.<BR>
No TAG format syntax is available for transaction statements, because the code inner this type of statement
may be as short as possible.<BR>
<BR>
</LI>
</UL>
<BR>
<HR>
<A NAME="#comments"><H3>Comments</H3>
<BR>
Comments presents Java-like syntax:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>Example:</B><BR>
<pre>
// this is a single line comment
/*
this is a multi line comment...
...............................
*/
</pre>
</blockquote>
Comments aren't passed to the compiled file.<BR>
<BR>
<HR>
<A NAME="#directives"><H3>Directives</H3>
<BR>
There are two types of directives:<BR>
<UL>
<LI>
Evaluated at compile time;
</LI>
<LI>
Special directives;
</LI>
</UL>
<BR>
The first type of directives are evaluated at compile time.<BR>
This is the standard of a directive in all the other languages.<BR>
<BR>
The directives are:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#self</B><BR>
</blockquote>
Represent the complete name of the page (with extension) is compiling.<BR>
This directive is can't be used in module generation.<BR>
<BR>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#asp</B><BR>
<I>...asp code...</I><BR>
<B>#/asp</B><BR>
</blockquote>
To include ASP source code directly in your pages.<BR>
The block of code is compiled only if you are in ASP compile mode.<BR>
NOT SUPPORTED YET!
<BR>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#jsp</B><BR>
<I>...jsp code...</I><BR>
<B>#/jsp</B><BR>
</blockquote>
To include JSP source code directly in your pages.<BR>
The block of code is compiled only if you are in JSP compile mode.<BR>
NOT SUPPORTED YET!
<BR>
<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#php</B><BR>
<I>...php code...</I><BR>
<B>#/php</B><BR>
</blockquote>
To include PHP source code directly in your pages.<BR>
The block of code is compiled only if you are in PHP compile mode.<BR>
<BR>
<BR>
<BR>
The special directives are:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#include</B> <I>"filename"</I><BR>
</blockquote>
This a Server Side Include directive.<BR>
The filename MUST be a string value (can't be a variable).<BR>
Note that the other file isn't compiled while including, but must be compiled separately.<BR>
<BR>
A special syntax for module inclusion is:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#include</B> <I><modulename></I><BR>
</blockquote>
The modulename MUST be a fixed value (can't be a variable) WITHOUT any extension.
The extension will be added later by the <B><I>lisa</I></B> compiler.<BR>
Note that the other file isn't compiled while including, but must be compiled separately.<BR>
<BR>
<BR>
<BR>
<HR>
<A NAME="#config">
<H2>XML CONFIGURATION</H2>
The <B>lisa</B> compiler may configured with a standard XML file called <I>'config.xml'</I>.<BR>
By now, the <I>config.xml</I> file describe the database parameters.<BR>
You can found an example configuration file in the <B>lisa</B> archive.<BR>
<BR>
<B>WARNING</B><BR>
Some informations presents in the <I>config.xml</I> file (like dsn, username and password, etc...)
may be very important for the security of your site.<BR>
The <I>config.xml</I> file may NOT be present in your product site, but only in your dev-machine.<BR>
<BR>
<HR>
<A NAME="#xmldatabase"><H3>Database setup</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-dsn></B> data source name <B></db-dsn></B>
</div>
This is the database dsn.<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-host></B> host name <B></db-host></B>
</div>
This is the database server hostname. You can specify the full URL name or the static IP address.<BR>
Leaving this field blank will automatically set the IP number 127.0.0.1 (localhost).<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-name></B> database name <B></db-name></B>
</div>
This is the database name. This field is obligatory.<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-password></B> password <B></db-password></B>
</div>
This is the password used connecting to database.<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-port></B> port number <B></db-port></B>
</div>
This is the database port whitch the server is waiting connections.<BR>
Leaving this field blank will automatically set the default port for the specified database type.<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-type></B> database type <B></db-type></B>
</div>
This is the database server type you're using.
Just enter any of the follow types:<BR>
<I>mySql</I><BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><db-username></B> username <B></db-username></B>
</div>
This is the username used connecting to database.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><jdbc></B> <I>see the follow tags</I> <B></jdbc></B>
</div>
This block contains the JDBC control tags.<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><jdbc-driver></B> driver name <B></jdbc-driver></B>
</div>
This is the class name of the JDBC driver.<BR>
</blockquote>
<blockquote>
<div style="background-color:#CDCDCD;">
<B><jdbc-string></B> connection string <B></jdbc-string></B>
</div>
This is the connection string used by the JDBC driver connecting to database.<BR>
</blockquote>
</blockquote>
<BR>
<BR>
<HR>
<A NAME="#modules">
<H2>MODULES</H2>
You can create a function library for simplify the managing of your applications. This library
is called <I>module</I>. Creating modules is very simple, just call the <I><B>lisa</B> compiler</I>
like the following example:
<blockquote style="background-color:#CDCDCD;">
<B>lisac</B> --module --php <I>modulename.lisa</I><BR>
</blockquote>
As you can see, the <I>--module</I> option (or <I>-m</I> in short form) is the way to inform the
compiler that you want generate a module, nor the file generated is standard.<BR>
The module generated can be used in your applications by the <I>#include</I> directive:<BR>
<blockquote style="background-color:#CDCDCD;">
<B>#include</B> <I><modulename></I><BR>
</blockquote>
Note that the <I>modulename</I> is specified WITHOUT any extension.<BR>
<BR>
<H4>IMPORTANT</H4>
You're be warned to prevent recursive module inclusions: the Web Server may generate some errors.<BR>
<BR>
<HR>
<A NAME="#std"><H3>The standard module <big>std</big></H3>
<BR>
The <B>std</B> module is automatically included in every standard page you create.<BR>
You must compile the <I>std.lisa</I> file as a module and place the result in the same
directory of your deployed application.<BR>
<BR>
There are some useful functions for your applications:<BR>
<BR>
<HR>
<A NAME="#supportf"><H3>Language support functions</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>number</I> = <B>arrSize</B>( <I>array</I> )<BR>
</div>
This function return the number of items contained in an array.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>string</I> = <B>page</B>( <I>string</I> )<BR>
</div>
This function will return the complete page name (with extension) of the name
specified as argument.<BR>
</blockquote>
<BR>
<HR>
<A NAME="#datef"><H3>Date and Time functions</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>number</I> = <B>dtmDay</B>( <I>timestamp</I> )<BR>
</div>
This function return the day number of the month from a timestamp value.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>number</I> = <B>dtmMonth</B>( <I>timestamp</I> )<BR>
</div>
This function return the month number from a timestamp value.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>timestamp</I> = <B>dtmTimestamp</B>( )<BR>
</div>
This function will return the current Un*x timestamp.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>number</I> = <B>dtmYear</B>( <I>timestamp</I> )<BR>
</div>
This function return the year number from a timestamp value.<BR>
</blockquote>
<BR>
<HR>
<A NAME="#documentf"><H3>Document functions</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B>echo</B>( <I>string</I> )<BR>
</div>
This function will write the message contained in the string to the generated
HTML document.<BR>
</blockquote>
<BR>
<HR>
<A NAME="#mathf"><H3>Math functions</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B>mthRandom</B>( <I>number</I> )<BR>
</div>
This function return a 'random' integer number between 0 and the number specified - 1.<BR>
</blockquote>
<BR>
<HR>
<A NAME="#stringf"><H3>String functions</H3>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>string</I> = <B>strHTML</B>( <I>string</I> )<BR>
</div>
This function replace all HTML special chars with their equivalents for a correct visualization.<BR>
In addiction, '\n' (newline) chars are replaced with a "<BR/>" HTML tag.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>string</I> = <B>strTrim</B>( <I>string</I> )<BR>
</div>
This function strip blank characters from the init and the end of a string.<BR>
</blockquote>
<BR>
<HR>
<A NAME="#dbsupport"><H3>The database module <big>dbsupport</big></H3>
<BR>
The <B>dbsupport</B> module is automatically included in every standard page you
create, when a database engine is specified via <B>config.xml</B>.<BR>
This module is automatically created by the compiler, you must only place the
result in the same directory of your deployed application.<BR>
<BR>
Now follow an explanation of all the public functions provided by this module:<BR>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>boolean</I> = <B>dbEmpty</B>( <I>set</I> )<BR>
</div>
This is a boolean function. It will return a true value if the set contains no
data.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<I>set</I> = <B>dbQuery</B>( <I>string</I> )<BR>
</div>
This function will execute a query (contained into string) on the specified
database. It will return a <I>set</I> of the results.<BR>
This function will block if an error is occured while the query execution.<BR>
</blockquote>
<BR>
<blockquote>
<div style="background-color:#CDCDCD;">
<B>dbSql</B>( <I>string</I> )<BR>
</div>
This function is similar to <I>dbQuery</I>, but no values will be returned. This
can be useful for SQL update statements, like 'INSERT' or 'UPDATE'.
</blockquote>
<BR>
<BR>
<HR>
<A NAME="#examples">
<H2>EXAMPLES / TUTORIALS</H2>
<A HREF="example1.html" TARGET="_blank">Example 1: Simple access to a database table.</A><BR>
<BR>
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -