| Applying science to business management |
  
What is an Envelope
Envelopes control the general look of your application. They
are simply HTML documents that include headers, footers,
graphics, and other standard HTML elements. Envelopes also
include special fill codes, such as %FORM%
and %BUTTONS%, that tell
DecisionScript where to place key information.
For example, a DecisionScript statement such as
say("Hello World!")
will be presented to the user like this using the default
envelope:
The only portion of this screen that came from the
DecisionScript statement is the text Hello
World!. All other parts of this screen came from the
envelope file Standard.htm, which has the following
contents:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Vanguard
DecisionScript">
<title>%TITLE%</title>
</head>
<body bgcolor="#FFFFFF" text="#000000"
link="#0000FF" vlink="#0000FF">
<table border="0" cellpadding="0"
cellspacing="0" width="600">
<tr>
<td>
<img
src="Banner.jpg?Envelopes" width="600"
height="42">
<p
align="center">%HEADER%</p>
<form
action="dscript" method="post">
<div
align="center"><center>
<table
border="2" cellpadding="0"
cellspacing="0">
<tr>
<td
bgcolor="#000080"><font
color="#FFFFFF">
<b> %TITLE%</b></font></td>
</tr>
<tr>
<td><table
border="0" cellpadding="10"
cellspacing="0"
width="100%">
<tr>
<td>%FORM%</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table
border="0" cellpadding="10"
cellspacing="0"
width="100%">
<tr>
<td><%
IF(dialogbuttons&&ExecLog!="","<input
type=\"button\"
VALUE=\"History\"
onClick=\"window.open('dscript?EXEC-
%SESSIONID%-showlog','','width=400,
height=300,toolbar=0,location=0,
directories=0,status=0,menuBar=1,
scrollBars=1,resizable=1')\">","")
%>
</td>
<td
align="right">%BUTTONS%</td>
</tr>
</table>
</td>
</tr>
</table>
</center></div>
</form>
<p
align="center">%FOOTER%</p>
<hr>
<p
align="center"><font size="2">
Choose
<i>Script Options</i> under the
<i>Tools</i> menu to set
properties<br>
affecting the
general look and operation of this script.
</font></p>
<p
align="right"><img
src="PoweredBy.jpg?Envelopes" hspace="0"
width="112"
height="32"></p>
</td>
</tr>
</table>
</body>
</html>
If you use the envelope file Simple.htm, the screen
looks like this:
The file Simple.htm has the following contents:
<html>
<head>
<title>%TITLE%</title>
</head>
<body bgcolor="#FFFFFF" text="#000000"
link="#0000FF" vlink="#0000FF">
<p>%HEADER%</p>
<form action="dscript" method="post">
<p><b>%TITLE%</b></p>
<p>%FORM%</p>
<p>%BUTTONS%</p>
</form>
<p>%FOOTER%</p>
</body>
</html>
As you can see, the envelope has a significant impact on the
look of your script.
DecisionScript includes a library of standard envelop files
that you can use in your scripts. However, developers often build
their own envelope files so that they can deploy DecisionScript
applications that have a look matching the rest of their Web
site.
If you use a single envelope for many scripts, changing the
look of all the scripts to keep up with changes in your Web site
will require changes in only one envelope file.
|