Welcome to ASP Compiler 1.1 beta
Compiling ASP pages is not the only area where you can use ASPC. It has
two major aims - to help you build VB projects and then DLLs from VBScript
files (ASP and others) and to help you script the build process which can be
combined with the first one or can be used for huge HTML sets generation
from DB, from preformatted pages (with includes for example) etc.
Note that IIS and ALP are script hosts and thus ASP is just one area of
VBScript application. There are many and many other script hosts
supporting VBScript. And while some of them (Windows Scripting Host for
example) are widely known others are part of other software with narrowed
area of application. Wherever the script is plain and can be replaced with
a COM component(s) you can probably use ASPC to help you do this.
What are the benefits - better performance where calculations are made
in the script (complex logic, arithmetic operations etc.), hiding your
source code in best possible manner (any encryption applied for scripting
languages or even such modern things like .NET and Java) is reversible and
thus can be cracked.
The Compile-Time scripting allows something else - ability to embed or
attach executable code to HTML pages and process them. This allows you to
build generators for sites, help files etc. Combined with ASP this
gives you three levels of programming opportunities - server side (ASP),
compiler (ASPC) and client side (DHTML) - adds additional layer which can
be extremely useful sometimes - where the manual work includes boring
operations that the computer can do for you.
This version is still named beta but in fact it is final except some
documentation and some secondary features.
ASP Compiler (ASPC) functionality could be described as two major parts:
- Pre-compilation of VBScript (ASP pages, WSH and others) to Microsoft Visual Basic
and COM DLLs.
- User defined conversions/modifications of HTML and ASP files and
automatic code generation - Compile Time Scripting (CTS)
The both can be used together to form a powerful tool for WEB and other VBScript based
The ASPC may help the developers in different ways:
- To improve the application performance and keep the source code
private by converting ASP pages to COM DLL.
- To generate and regenerate frequently sites (or their parts) that
contain dynamic information and deploy them on the WEB server as
static HTML pages or simple ASP pages lowering the costs for server
hardware and software and improving the site performance.
- To automate step by step some of the repeated programming
- To extract information from existing HTML pages, organize
them, generate indices/trees and whatever is needed to pack or
organize the WEB site or documentation more or less automatically.
These are only a few of the possible applications of ASPC. It is enough
flexible to allow the programmer to add new features or automate some
tasks as needed.
While most of the environments offering some help to the programmer are
"wizard" and UI oriented - ASPC goes another way. It is designed
to allow the programmer to write code that writes/modifies another code
step by step. This is done by the so called (in this documentation)
compile time scripts (CTS). They could be written in already familiar
preferred, other languages. CTS syntax is designed to follow the
programmer and the developer may choose the right form for the current
stage of his/her work - use embedded scripts in the pages until not sure
what exactly must be done, then move them to external files for easy
reusability as the script becomes better organized and already tested and
finally pack it in the CTS library and add configuration dialog to allow
the colleagues to use it without bothering them with details.
All these methods could be combined as appropriate. Also it is very
important that scripts of common use - performing tasks needed by many
developers could be downloaded and installed! We supply with the initial
version some scripts written as examples or developed during our work. The
library of CTS scripts will grow in time, but note you could supply
(or sell) CTS scripts too!
See more details on:
How ASP pages become COMponent DLL.
Learn more for the Compile Time Scripting
Using the ASPC's parser without the compiler - Using HTML
templates in ASP sites.
As you probably already guessed an ASP page managed by a CTS could be
also compiled to a DLL. Thus the point where the compilation process will
end depends on your needs and the usage of the certain page (s). The CTS
itself could be compiled to a DLL too - in most cases it is better to keep
it in plain script source to allow additional changes and extensions to be
made, but if a certain script become a complete solution for a certain
problem - packaging worth to be done.
General topics, tutorials and miscellaneous information.
First step: How to create and compile an ASPC project
Guide on how to work with ASPC, how to add files, how to specify the way they will be
Tutorials: Learn in several steps how to compile an
ASP site, how to write simple CTS script embedded in a file or attached to it, how to use
the CTS and ASPC to generate HTML content on your machine and deploy it as plain HTML
Deployment of the resulting components. Contains
information on DLL deployment and environment requirements.
Compatibility. Describes the ASP/VBS features
which cannot be used or which may cause problems. See
also the new AutoVariables
directive which will help you avoid spending time on declaring the
undeclared variables in many cases.
Execution contexts and variable scopes - what
ASPC does with your Functions/Subs and VBScript Classes. ASPC does not require option
explicit but it issues warnings for the non-declared variables. If you are using classes
in your ASP/VBS this chapter will help you to avoid logical errors with the variable
Program IDs. How to choose the project name and how
to avoid problems caused by overlapping program IDs. Recommended to the developers with no
experience in COM programming.
How to adopt ASP/VBS applications. ASPC allows the
developer to do a bit more than usual - knowing that the ASPC will be used at some stage
of the project the developer is able to improve the application using some ASPC features.
References and details:
Processing options. How to select the compilation
result, how to convert SSI (Server side includes) file to plain HTML, how to convert ASP
to plain form - with only one pair <% %> and so on.
Compile Time Scripting object model and syntax.
What replaces the ASP page/VBScript file. What is the
result of the ASPC and VB usage. How the compiled page/script is represented in the
ASPC directives. Reference of the ASPC directives -
supported to allow advanced control of the compilation. Using the directives you can build
true COM libraries intended for usage in many different applications. It requires just a
little reading and no additional VB or COM knowledge.
Errors and warnings.
Reference of the erorrs and warnings issued by the compiler.
For VB developers
Using ASPC for code generation in VB applications.
Using an VB example shows how ASPC components can be used in a VB IE hosting application.