#set TITLE = "Basics"

#include top

.SH Basics

.LP
Start with a file with HTML in it, located in the \fC./pages\fR
subdirectory that is created when you 
#set FILE = "installing.html"
#set TAG = "set up your project."
#include link
The file can be named anything.. an \fC.html\fR suffix is not required nor recommended.
Also, the file does not need to contain an \fC<html>\fR tag.

#include space2

.LP
Add QUISP directives.
QUISP directives begin with pound sign (#).  An example is \fC#if\fR.
A directive occupies one (and only one) line.
The various directives are listed
#set FILE = "quisp_home.html"
#set TAG = "on the front page"
#include link
and on the 
#set FILE = "quickref.html"
#set TAG = "quick reference syntax summary."
#include link

#include space2

.LP
Any line where the first non-whitespace content is \fC//\fR is a comment and is ignored.

#include space2

.LP
QUISP uses 
#set FILE = "variables.html"
#set TAG = "variables."
#include link
Variables can be set directly using the \fC#set\fR directive, or they may be set based on incoming CGI
user variables (embedded in the URL or submitted via a form POST) or cookies.
Variables are written with a leading
at-sign (\fB@\fR) when the contents are to be displayed or referenced.

Variables are delimited on whitespace and punctuation characters except underscore and period.
User variable names must begin with an alphabetic character and can contain 
alphanumerics and underscores.  Variables originating from an sql join result
will contain an embedded period.
Thus, something like \fC @a.@b \fR will not work because the period is taken
to be part of the variable name.

#include space2

.LP
Any line that is not a directive or a comment is output directly, with @@variables evaluated.
Thus there is often no need for "print" statements.  Also, quoting hassles are minimized.

#include space
.SH Simple example 1
Here's a simple example... suppose it resides in a file called \fCtest1\fR...
.ig >>
<table cellpadding=5 border=1><tr bgcolor=FFFFEC><td>
.>>
.nf
\0 // a simple example..
\0 #cgivar xval
\0 <title>My first QUISP page</title>
\0 <body bgcolor=FFFFFF>
\0 <br>
\0 <h2>My first QUISP page</h2>
\0 #if @x = ""
\0    parameter xval was not supplied.
\0 #else
\0    you passed xval as @@xval !
\0 #endif
\0 <br>
\0 <br>
\0 <a href="?rtn=test1&xval=8">Try it again with xval = 8</a>
.fi
.ig >>
</td></tr></table>
.>>
Note the last line.. the page contains a link back to itself.
The special variable \fBrtn\fR names the QUISP page to be loaded.

.LP
Now view your result by going to a URL like this:
\fC http://yourdomain.org/cgi-bin/quispcgi?rtn=view1&xval=5 \fR
.LP
(specifics will of course depend on your home system)

#include space

.LP
.SH Simple example 2
Now let's take the same example and add a fill-in field...
when the user clicks on [Go] the page will "call itself", sending the
entered value for \fCxval\fR.
.ig >>
<table cellpadding=5 border=1><tr bgcolor=FFFFEC><td>
.>>
.nf
\0 // simple example II..
\0 #cgivar xval
\0 <title>My first QUISP page</title>
\0 <body bgcolor=FFFFFF>
\0 <br>
\0 <h2>My first QUISP page</h2>
\0 #if @x = ""
\0    parameter xval was not supplied.
\0 #else
\0    you passed xval as @@xval !
\0 #endif
\0 <br>
\0 <br>
\0 <form action="@@CGIPROG" method=GET>
\0 #formtarget test1
\0 Enter a value: <input name=xval value="@xval" size=6>
\0 <input type=submit value="Go">
\0 </form>
.ig >>
</td></tr></table>
.>>

#include bottom

