home *** CD-ROM | disk | FTP | other *** search
- #set title htmlPX - Reference Guide
-
- {hdr}
- <hr>
-
- #call section Commands
-
- <p>
- The following commands are supported by htmlPX 1.0. Each command must begin on a separate line, and the command
- must be the first thing on the line.
-
- <table>
- <tr>
- <td><font color="{trimcolor}"><b><u>Command</u></b></font></td>
- <td><font color="{trimcolor}"><b><u>Description</u></b></font></td>
- </tr>
-
- <tr>
- <td valign="top" width="25%"><b><i>comments</i></b></td>
- <td>
- Comments in htmlPX are lines that begin with an asterisk. You cannot have comments at the end of an active
- line. Only entire lines can be comments.
- </td>
- </tr>
-
- <tr>
- #call commanddef #ECHO|echo-line
- <td>
- This command will cause the contents of the line to be written to stdout. It can be used in the .SF to give status
- information or error information during the generation of the website. It can be used in the template files also
- for debugging or status notification.
- </td>
- </tr>
-
- <tr>
- #call commanddef #LOAD|filename
- <td>
- This command will load the library file that is specified. The library file can contain variables, code blocks, and
- functions. These "objects" will become available for the following template files. The variables are
- defined by the #SET command, the code blocks are defined by the #DEFINE command, and the functions are defined by
- the #FUNCTION command. See the description of each of those commands for further information.
- <p>
- The files that are loaded will be used to determine whether an output file should be made when a #MAKE is encountered.
- </td>
- </tr>
-
- <tr>
- #call commanddef #USING|filename
- <td>
- This command will cause the specified file to be considered when determining whether to execute a #MAKE or not. If
- this file is newer than the output file of the #MAKE command, the #MAKE will be executed. This command would be
- necessary if a particular library file is not loaded before the #MAKEs begin or if an #INCLUDE file should be
- considered when determining whether to make an output file.
- </td>
- </tr>
-
- <tr>
- #call commanddef #INCLUDE|filename
- <td>
- This command will insert the file specified into the output file at this point. Variables, code blocks, and
- functions will be processed as normal when the file is inserted.
- </td>
- </tr>
-
- <tr>
- #call commanddef #SET|variable-name value
- <td>
- Used to create a variable and assign a value to that variable. The <i>value</i> is optional. If it is not included,
- the variable will have an empty string as its value. <br><br>
- The scoping rules for variables are simple. A variable defined in the .SF file is global and in effect throughout
- the generation of the website unless the #UNDEF is used. A variable defined within a template file will remain in
- effect throughout the processing of that template file after which time it will be automatically <i>undeffed</i>.
- Redefining an existing variable will not remove a preexisting variable from a file higher in the order, it will only
- temporarily replace the value. The new value will stay in effect until that variable goes out of scope.
- </td>
- </tr>
-
- <tr>
- #call commanddef #DEFINE|code-block-name
- <td>
- Used to define a code block in a library or template file. The code block will follow this command and will be
- terminated by the #END command. The code block may contain any HTML code, text, variables, other code blocks, and
- functions which will be processed just like it were in-line code.
- </td>
- </tr>
-
- <tr>
- #call commanddef #FUNCTION|function-name
- <td>
- Used to define a code block which can accept parameters. The code block can be called with the #CALL command which
- contains the parameters that are passed. The parameters are accessed in the code block with the variables {$1}, {$2},
- and {$n} where n is the maximum number of parameters. $NP contains the number of parameters that were passed to
- the function by the #CALL command.
- <p>
- The #FUNCTION code block is ended by the #END command just like #DEFINE.
- </td>
- </tr>
-
- <tr>
- #call commanddef #UNDEF|variable-name
- <td>
- This command will destroy the named variable, code block, or function which will no longer be available for use.
- </td>
- </tr>
-
- <tr>
- #call commanddef #CALL|function-name parameters
- <td>
- This command calls a function that has previously been defined. It specifies the function name and the parameters
- that are being passed. The parameters are separated by the parameter delimiter which defaults to "|".
- The parameter delimeter can be customized with the #PARMDELIM command.
- </td>
- </tr>
-
- <tr>
- #call commanddef #FORALL|file-name field-delimiter
- <td>
- This command allows htmlPX to process an ASCII file that contains records. The filename that is specified is opened
- and each row is parsed into separate fields. The field separator is "|" by default, but can be changed
- as the second operand of the #FORALL command, which is optional. The code that is located between the #FORALL and its
- following #ENDLOOP command is processed for each record in the data file. This allows the htmlPX programmer to
- create table-driven HTML output.
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#ENDLOOP</i></b></td>
- <td>
- This command ends the #FORALL loop and will return to the top of the loop until it reaches the end of the data file.
- </td>
- </tr>
-
- <tr>
- #call commanddef #BANNER|color
- <td>
- This command generates a banner to direct users to the htmlPX website. Since this is free software, I ask you to
- help advertize by directing user of your web pages to the htmlPX web page. You can set the color of the banner to
- WHITE, GREEN, RED, or YELLOW with YELLOW being the default. This banner is quite small and unobtrusive. Thanks
- for putting it in your web page.
- <tr>
- <td valign="top"><b><i>#ENDLOOP</i></b></td>
- <td>
- This command ends the #FORALL loop and will return to the top of the loop until it reaches the end of the data file.
- </td>
- </tr>
-
- </td>
- </tr>
-
- <tr>
- #call commanddef #INDIR|directory-name
- <td>
- The directory name identifies the directory where the input .HTT and .SNP files will be found. This command should
- be used in the .SF file if it is to be used. If it is not used, htmlPX will look in the current directory.
- </td>
- </tr>
-
- <tr>
- #call commanddef #OUTDIR|directory-name
- <td>
- The directory name identifies the directory where the resulting .HTM files will be placed. By default, they will
- go into the current directory. This command should
- be used in the .SF file if it is to be used.
- </td>
- </tr>
-
- <tr>
- #call commanddef #PARMDELIM|delimiter
- <td>
- Allows the user to specify the character that should be used as the parameter delimiter for the #CALL command
- parameters. By default the character is "|".
- </td>
- </tr>
-
- <tr>
- #call commanddef #BEGDELIM|beginning-delimiter-character
- <td>
- Specifies the beginning delimiter character for specifying a variable in a template file. By default this value
- is "{".
- </td>
- </tr>
-
- <tr>
- #call commanddef #ENDDELIM|ending-delimiter-character
- <td>
- Specifies the ending delimiter character for specifying a variable in a template file. By default this value
- is "}".
- </td>
- </tr>
-
- <tr>
- #call commanddef #MAKE|template-file output-file
- <td>
- This command is the work-horse. It identifies a template file that needs to be processed to create a resulting
- output HTML file.
- </td>
- </tr>
-
- <tr>
- #call commanddef #IF|variable-name value
- <td>
- This command provides the conditional compilation. You can check for the existence of a variable or whether the
- specified variable currently has the specified value. If the check is true, the enclosed code will the generated.
- If not true, the ELSE condition will be used. <i>(See #ELSE and #ENDIF.)</i>
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#ELSE</i></b></td>
- <td>
- This command is used as would be expected for conditional compilation.
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#ENDIF</i></b></td>
- <td>
- This command closes off the conditional compilation. It ends either the #IF or the #ELSE.
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#QUIT</i></b></td>
- <td>
- This command will cause htmlPX to stop processing the site file or the template file at this point. All commands
- following the #QUIT will be ignored.
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#SKIP</i></b></td>
- <td>
- This command will cause htmlPX to ignore the commands and text that appear between the #SKIP and the #ENDSKIP. It
- can be used to easily comment out sections of the code for testing.
- </td>
- </tr>
-
- <tr>
- <td valign="top"><b><i>#ENDSKIP</i></b></td>
- <td>
- This command causes htmlPX to begin processing once again after skipping commands and text.
- </td>
- </tr>
-
- </table>
-
- #call section Keywords
-
- <p>
- The following keywords can be used as variables to produce certain output. Currently, the keywords are all date
- related, but additional keywords are planned for future releases.
-
- <table>
- <tr>
- <td width="25%" valign="top"><b><i>#CURDATE</i></b></td>
- <td>
- This keyword will produce the current date in the form dd-Month-yy.
- </td></tr>
-
- <tr>
- <td valign="top"><b><i>#STARTDATE</i></b></td>
- <td>
- This keyword will produce the date the htmlPX application started in the form dd-Month-yy. It will almost always
- be equal to #CURDATE.
- </td></tr>
-
- <tr>
- <td valign="top"><b><i>#CURYR4</i></b></td>
- <td>
- This keyword will produce the current year in a four-digit format. (That makes us Y2K compliant, huh?)
- </td></tr>
-
- <tr>
- <td valign="top"><b><i>#CURYR2</i></b></td>
- <td>
- This keyword will produce the current year in a two-digit format. (That makes us Y2K compliant, huh?)
- </td></tr>
-
- <tr>
- <td valign="top"><b><i>#CL1 - #CL7</i></b></td>
- <td>
- This keyword refers to the user parameters that can be added to the command-line when htmlPX is executed.
- </td></tr>
-
- </table>
-
- {button}
- {foot}
-