Introduction to PPWIZARD, Part 2
By: Walter Metcalf
Last week we briefly introduced PPWizard,
one of the most unusual and powerful aids to writing HTML documents available. This week we'll continue the
series with a tutorial on using PPWizard to write an actual document.
For the purposes of this tutorial, I am going to show you how to use PPWizard macros and other features to
create the article I wrote on 10 November 1999 about Judge Jackson's
Findings of Fact in the DOJ vs. Microsoft trial.
- "Templates" in PPWizard terminology are files that you load
into your editor and then add to according to
- The article began with a template that looks something
|Article Template |
- The first group of statements--starting with "#define"--define variables according to:
- The document title that appears in the browser title and in the META Description line.
- The words and phrases that are used to seed the META Keyword line for the benefit of search
- The document date that appears in the browser title line and in the "Dateline" field.
- The text that appears under the "Next Week" image at the bottom of the article.
- The discussion ID in the Delphi Forum where you are invited to post your ideas on this topic.
- Header Files
- Header Files have an extension of ".ih" and become part of your program for compilation purposes
but do not actually appear in your editor file.
- Typically they contain variable or macro definitions, etc.
- In this case the only Header File used is Macro.ih, which contains all the general
purpose macros I use.
- Macro.ih contains several macros which together make up the standard beginning and standard
ending of a feature. Click here to see those
macros. Note that the variables Title, Keywords, etc. that were defined
at the beginning of the template are picked up by the macros FeatureHeader
and FeatureEnd, and inserted in the correct place in the HTML code.
- The macros and variables defined in a Header File are available for use in all lines of your
programs after the #include statement containing the Header File name.
- The main text, or body, of the article is placed between "Dateline" and <FeatureEnd>.
- Like FeatureHeader, FeatureHead contains macros and other definitions to handle the routine
text that occurs at the end of each article.
- Talkback Macro
- We'll go into more detail on macros next week, but as an interesting example on how variables can
be used to construct more complex expressions, let's look at the Talkback variable, which
is simply defined as a decimal number (e.g. 304.2).
- View the file 'MacroFeature.txt' and look for the
third line under the line "#define FeatureEnd". You'll see the two lines:
Desc="Talk Back"> to me with your questions and comments.
- ....$InLine.... is a call to a macro I wrote with two mandatory parameters: HTTP,
the URL, and Desc, the description displayed by the browser. SITE_ALIAS is a predefined
variable equal to this site ID, OS2.
- Now we are ready to see the result of the expansion of the macro InLine as used here:
- As many of you know already, simply clicking on that link takes you directly to the
discussion about PPWizard that's already underway. Once the macro is set up,
all I have to do is determine the correct number and enter it at the top of the article
template. That gives you a some idea of the power of macros in PPWizard.
- Now that I whetted your appetite, I hope you'll come back next week when I'll show you the nuts
and bolts of writing some actual macros.
Next week: Introduction to PPWIZARD, Part 3
Unless otherwise noted, all content on this site is Copyright © 2004, VOICE