home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / html_px / sample / ref.htt < prev    next >
Encoding:
Text File  |  1999-01-19  |  9.7 KB  |  290 lines

  1. #set title htmlPX - Reference Guide
  2.  
  3. {hdr}
  4. <hr>
  5.  
  6. #call section Commands
  7.  
  8. <p>
  9. The following commands are supported by htmlPX 1.0.  Each command must begin on a separate line, and the command
  10. must be the first thing on the line.
  11.  
  12. <table>
  13. <tr>
  14. <td><font color="{trimcolor}"><b><u>Command</u></b></font></td>
  15. <td><font color="{trimcolor}"><b><u>Description</u></b></font></td>
  16. </tr>
  17.  
  18. <tr>
  19. <td valign="top" width="25%"><b><i>comments</i></b></td>
  20. <td>
  21. Comments in htmlPX are lines that begin with an asterisk.  You cannot have comments at the end of an active
  22. line.  Only entire lines can be comments.
  23. </td>
  24. </tr>
  25.  
  26. <tr>
  27. #call commanddef #ECHO|echo-line
  28. <td>
  29. This command will cause the contents of the line to be written to stdout.  It can be used in the .SF to give status
  30. information or error information during the generation of the website.  It can be used in the template files also
  31. for debugging or status notification.
  32. </td>
  33. </tr>
  34.  
  35. <tr>
  36. #call commanddef #LOAD|filename
  37. <td>
  38. This command will load the library file that is specified.  The library file can contain variables, code blocks, and
  39. functions.  These "objects" will become available for the following template files.  The variables are
  40. defined by the #SET command, the code blocks are defined by the #DEFINE command, and the functions are defined by
  41. the #FUNCTION command.  See the description of each of those commands for further information.
  42. <p>
  43. The files that are loaded will be used to determine whether an output file should be made when a #MAKE is encountered.
  44. </td>
  45. </tr>
  46.  
  47. <tr>
  48. #call commanddef #USING|filename
  49. <td>
  50. This command will cause the specified file to be considered when determining whether to execute a #MAKE or not.  If
  51. this file is newer than the output file of the #MAKE command, the #MAKE will be executed.  This command would be
  52. necessary if a particular library file is not loaded before the #MAKEs begin or if an #INCLUDE file should be
  53. considered when determining whether to make an output file.
  54. </td>
  55. </tr>
  56.  
  57. <tr>
  58. #call commanddef #INCLUDE|filename
  59. <td>
  60. This command will insert the file specified into the output file at this point.  Variables, code blocks, and
  61. functions will be processed as normal when the file is inserted.
  62. </td>
  63. </tr>
  64.  
  65. <tr>
  66. #call commanddef #SET|variable-name value
  67. <td>
  68. Used to create a variable and assign a value to that variable.  The <i>value</i> is optional.  If it is not included,
  69. the variable will have an empty string as its value.  <br><br>
  70. The scoping rules for variables are simple.  A variable defined in the .SF file is global and in effect throughout
  71. the generation of the website unless the #UNDEF is used.  A variable defined within a template file will remain in
  72. effect throughout the processing of that template file after which time it will be automatically <i>undeffed</i>.
  73. Redefining an existing variable will not remove a preexisting variable from a file higher in the order, it will only
  74. temporarily replace the value.  The new value will stay in effect until that variable goes out of scope.
  75. </td>
  76. </tr>
  77.  
  78. <tr>
  79. #call commanddef #DEFINE|code-block-name
  80. <td>
  81. Used to define a code block in a library or template file.  The code block will follow this command and will be
  82. terminated by the #END command.  The code block may contain any HTML code, text, variables, other code blocks, and
  83. functions which will be processed just like it were in-line code.
  84. </td>
  85. </tr>
  86.  
  87. <tr>
  88. #call commanddef #FUNCTION|function-name
  89. <td>
  90. Used to define a code block which can accept parameters.  The code block can be called with the #CALL command which
  91. contains the parameters that are passed.  The parameters are accessed in the code block with the variables {$1}, {$2},
  92. and {$n} where n is the maximum number of parameters.  $NP contains the number of parameters that were passed to
  93. the function by the #CALL command.
  94. <p>
  95. The #FUNCTION code block is ended by the #END command just like #DEFINE.
  96. </td>
  97. </tr>
  98.  
  99. <tr>
  100. #call commanddef #UNDEF|variable-name
  101. <td>
  102. This command will destroy the named variable, code block, or function which will no longer be available for use.
  103. </td>
  104. </tr>
  105.  
  106. <tr>
  107. #call commanddef #CALL|function-name parameters
  108. <td>
  109. This command calls a function that has previously been defined.  It specifies the function name and the parameters
  110. that are being passed.  The parameters are separated by the parameter delimiter which defaults to "|".
  111. The parameter delimeter can be customized with the #PARMDELIM command.
  112. </td>
  113. </tr>
  114.  
  115. <tr>
  116. #call commanddef #FORALL|file-name field-delimiter
  117. <td>
  118. This command allows htmlPX to process an ASCII file that contains records.  The filename that is specified is opened
  119. and each row is parsed into separate fields.  The field separator is "|" by default, but can be changed
  120. as the second operand of the #FORALL command, which is optional.  The code that is located between the #FORALL and its
  121. following #ENDLOOP command is processed for each record in the data file.  This allows the htmlPX programmer to
  122. create table-driven HTML output.
  123. </td>
  124. </tr>
  125.  
  126. <tr>
  127. <td valign="top"><b><i>#ENDLOOP</i></b></td>
  128. <td>
  129. This command ends the #FORALL loop and will return to the top of the loop until it reaches the end of the data file.
  130. </td>
  131. </tr>
  132.  
  133. <tr>
  134. #call commanddef #BANNER|color
  135. <td>
  136. This command generates a banner to direct users to the htmlPX website.  Since this is free software, I ask you to
  137. help advertize by directing user of your web pages to the htmlPX web page.  You can set the color of the banner to
  138. WHITE, GREEN, RED, or YELLOW with YELLOW being the default.  This banner is quite small and unobtrusive.  Thanks
  139. for putting it in your web page.
  140. <tr>
  141. <td valign="top"><b><i>#ENDLOOP</i></b></td>
  142. <td>
  143. This command ends the #FORALL loop and will return to the top of the loop until it reaches the end of the data file.
  144. </td>
  145. </tr>
  146.  
  147. </td>
  148. </tr>
  149.  
  150. <tr>
  151. #call commanddef #INDIR|directory-name
  152. <td>
  153. The directory name identifies the directory where the input .HTT and .SNP files will be found.  This command should
  154. be used in the .SF file if it is to be used.  If it is not used, htmlPX will look in the current directory.
  155. </td>
  156. </tr>
  157.  
  158. <tr>
  159. #call commanddef #OUTDIR|directory-name
  160. <td>
  161. The directory name identifies the directory where the resulting .HTM files will be placed.  By default, they will
  162. go into the current directory.  This command should
  163. be used in the .SF file if it is to be used.
  164. </td>
  165. </tr>
  166.  
  167. <tr>
  168. #call commanddef #PARMDELIM|delimiter
  169. <td>
  170. Allows the user to specify the character that should be used as the parameter delimiter for the #CALL command
  171. parameters.  By default the character is "|".
  172. </td>
  173. </tr>
  174.  
  175. <tr>
  176. #call commanddef #BEGDELIM|beginning-delimiter-character
  177. <td>
  178. Specifies the beginning delimiter character for specifying a variable in a template file.  By default this value
  179. is "{".
  180. </td>
  181. </tr>
  182.  
  183. <tr>
  184. #call commanddef #ENDDELIM|ending-delimiter-character
  185. <td>
  186. Specifies the ending delimiter character for specifying a variable in a template file.  By default this value
  187. is "}".
  188. </td>
  189. </tr>
  190.  
  191. <tr>
  192. #call commanddef #MAKE|template-file output-file
  193. <td>
  194. This command is the work-horse.  It identifies a template file that needs to be processed to create a resulting
  195. output HTML file.
  196. </td>
  197. </tr>
  198.  
  199. <tr>
  200. #call commanddef #IF|variable-name value
  201. <td>
  202. This command provides the conditional compilation.  You can check for the existence of a variable or whether the
  203. specified variable currently has the specified value.  If the check is true, the enclosed code will the generated.
  204. If not true, the ELSE condition will be used.  <i>(See #ELSE and #ENDIF.)</i>
  205. </td>
  206. </tr>
  207.  
  208. <tr>
  209. <td valign="top"><b><i>#ELSE</i></b></td>
  210. <td>
  211. This command is used as would be expected for conditional compilation.
  212. </td>
  213. </tr>
  214.  
  215. <tr>
  216. <td valign="top"><b><i>#ENDIF</i></b></td>
  217. <td>
  218. This command closes off the conditional compilation.  It ends either the #IF or the #ELSE.
  219. </td>
  220. </tr>
  221.  
  222. <tr>
  223. <td valign="top"><b><i>#QUIT</i></b></td>
  224. <td>
  225. This command will cause htmlPX to stop processing the site file or the template file at this point.  All commands
  226. following the #QUIT will be ignored.
  227. </td>
  228. </tr>
  229.  
  230. <tr>
  231. <td valign="top"><b><i>#SKIP</i></b></td>
  232. <td>
  233. This command will cause htmlPX to ignore the commands and text that appear between the #SKIP and the #ENDSKIP.  It
  234. can be used to easily comment out sections of the code for testing.
  235. </td>
  236. </tr>
  237.  
  238. <tr>
  239. <td valign="top"><b><i>#ENDSKIP</i></b></td>
  240. <td>
  241. This command causes htmlPX to begin processing once again after skipping commands and text.
  242. </td>
  243. </tr>
  244.  
  245. </table>
  246.  
  247. #call section Keywords
  248.  
  249. <p>
  250. The following keywords can be used as variables to produce certain output.  Currently, the keywords are all date
  251. related, but additional keywords are planned for future releases.
  252.  
  253. <table>
  254. <tr>
  255. <td width="25%" valign="top"><b><i>#CURDATE</i></b></td>
  256. <td>
  257. This keyword will produce the current date in the form dd-Month-yy.
  258. </td></tr>
  259.  
  260. <tr>
  261. <td valign="top"><b><i>#STARTDATE</i></b></td>
  262. <td>
  263. This keyword will produce the date the htmlPX application started in the form dd-Month-yy.  It will almost always
  264. be equal to #CURDATE.
  265. </td></tr>
  266.  
  267. <tr>
  268. <td valign="top"><b><i>#CURYR4</i></b></td>
  269. <td>
  270. This keyword will produce the current year in a four-digit format.  (That makes us Y2K compliant, huh?)
  271. </td></tr>
  272.  
  273. <tr>
  274. <td valign="top"><b><i>#CURYR2</i></b></td>
  275. <td>
  276. This keyword will produce the current year in a two-digit format.  (That makes us Y2K compliant, huh?)
  277. </td></tr>
  278.  
  279. <tr>
  280. <td valign="top"><b><i>#CL1 - #CL7</i></b></td>
  281. <td>
  282. This keyword refers to the user parameters that can be added to the command-line when htmlPX is executed.
  283. </td></tr>
  284.  
  285. </table>
  286.  
  287. {button}
  288. {foot}
  289.  
  290.