APGen Documentation Previous Topic: Comparison of ASP to APGen Next Topic: Editing APG Scripts Parent Topic: Introduction to APGen    Introduction to APGen
APG Scripts
See Also:

APG scripts are text files consisting of blocks of script and content.  Following is a very simple APG script, named hello.apg:

<%#
Output.Filename = "hello.htm"

#%>

<HTML><BODY><H2>
Hello World!
</H2></BODY></HTML>

Script blocks are surrounded with <%#... #%> brackets.  Content blocks are any blocks of text not surrounded by the script brackets.  In the APGen documentation, content blocks are highlighted with this color.

The script block in the above example sets the Filename property of the Output object.  This tells APGen the name of the file to be created.  For most APG scripts, the Output.Filename property should be set before any content is generated.

The content block in the above example contains HTML content.  This HTML is written to the output file.  When the above script is executed, a hello.htm file is created in the same directory as hello.apg.  Below is the content generated by the hello.htm file:


<HTML><BODY><H2>
Hello World!
</H2></BODY></HTML>

This is not a complicated example, but it does illustrate the syntax and generation capabilities of APGen.  For more examples see APGen Examples.