home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / apps / powerbase / Docs / ScriptFile < prev    next >
Encoding:
Text File  |  1994-04-10  |  9.0 KB  |  245 lines

  1.                                 Script Files
  2.                                 ============
  3.  
  4. Powerbase incorporates a SCRIPT LANGUAGE which enables you to control some
  5. of its features from a SCRIPT FILE. Using script files you can automate jobs
  6. which need to be done frequently. Print jobs are the most obvious example,
  7. and most of the script commands have to do with printing, but there are
  8. others.
  9.  
  10. Script files are plain text files (created with !Edit) and are executed by
  11. simply dragging them onto the main Powerbase window. All the commands in a
  12. script file must be in upper-case letters, preceded by '!', and may be
  13. followed by a parameter string, separated from the command by a single
  14. space. Here is a full list of the commands followed by a description of
  15. their functions:-
  16.  
  17.         !SCRIPT POWERBASE,END,<filename>
  18.         !COMMENT
  19.         !SELECTION <filename>
  20.         !PRINTOPTS <filename>
  21.         !QUERY <search formula>
  22.         !CSV <search formula>
  23.         !EXPAND ON,OFF
  24.         !DATE ON,OFF
  25.         !UPPER ON,OFF
  26.         !UNDERLINE ON/OFF
  27.         !CASE ON/OFF
  28.         !INDEX ON/OFF
  29.         !FIRST ON/OFF
  30.         !SHRINK ON/OFF
  31.         !HEADINGS D,T
  32.         !PITCH 5,10,12,17
  33.         !TITLE <title>
  34.         !PAGE 70,66 etc
  35.         !LINESPACE 1,2 etc
  36.         !LMARGIN 1,5,10 etc
  37.         !TMARGIN 1,5,10 etc
  38.         !SPACER <spacer string>
  39.         !COLWIDTH 3,5,10 etc
  40.         !FORMAT HORIZONTAL,VERTICAL,LABEL,TABLExx
  41.         !DESTINATION WINDOW,FILE,PRINTER
  42.         !LABEL n,h,v,l,r,ON/OFF,ON/OFF
  43.         !DELETE <primary key>
  44.         !INSERT (followed by fields, each, inc. 1st, on its own line)
  45.         !IMPRESSION <'Impression' DDF string> [Not first]
  46.  
  47. !SCRIPT
  48. =======
  49. All script files must begin with the line !SCRIPT POWERBASE. This is how the
  50. program distinguishes a Powerbase script from other text files. You should
  51. make !SCRIPT END the last line of the file. Finally, the command can be used
  52. to "chain" another script file by following it with the name of the new
  53. file, i.e. by using the form !SCRIPT <filename>.
  54.  
  55. !COMMENT
  56. ========
  57. Use to insert explanatory comments in a script file. The rest of the line
  58. after the command is ignored.
  59.  
  60. !SELECTION <filename>
  61. =====================
  62. The parameter should be the name of a selection file in the PrintRes
  63. directory. The command will install the selection just as though you had
  64. dragged it from PrintRes to the Powerbase window yourself. If you issue the
  65. command without a parameter the current selection will be cleared.
  66.  
  67. !PRINTOPTS <filename>
  68. =====================
  69. The parameter should be the name of a print options file in the PrintRes
  70. directory. The options will be set just as if the the file had been dragged
  71. from PrintRes to the Powerbase window.  Issued without a parameter causes
  72. the default options to be set.
  73.  
  74. !QUERY <search formula>
  75. =======================
  76. This command is used to print a list. It gives the same result as typing the
  77. search formula into the Match window and clicking OK. If you first issue a
  78. !DESTINATION FILE command you can use a script containing a list of !QUERY
  79. commands to create a batch of reports as text files in PrintJobs. !CASE and
  80. !INDEX also affect the behaviour of this command if issued beforehand.
  81.  
  82. !CSV <search formula>
  83. =====================
  84. This works similarly to !QUERY but creates CSV files in PrintJobs instead of
  85. text files. There is no need to issue a !DESTINATION FILE before use. !CASE
  86. and !INDEX may be used as above.
  87.  
  88. !EXPAND
  89. =======
  90. Like many of the commands which follow, this is used to select or deselect a
  91. button in the print options window . !EXPAND ON selects the button which
  92. causes fields to be expanded by reference to a linked validation table. 
  93. !EXPAND OFF (or just !EXPAND by itself) deselects the button.
  94.  
  95. !DATE
  96. =====
  97. Turns date and time stamping ON and OFF. It works in exactly the same way as
  98. !EXPAND.
  99.  
  100. !UPPER
  101. ======
  102. Forces upper-case printing when followed by ON, normal upper/lower case
  103. printing otherwise.
  104.  
  105. !UNDERLINE
  106. ==========
  107. Turns underlining ON and OFF when output is sent to the printer. You will not
  108. see any underlining when the report is displayed in a window by Powerbase,
  109. but underlining will occur when the windowed output is subsequently printed.
  110.  
  111. !CASE
  112. =====
  113. Turns the 'Case specific' button in the Match window ON and OFF.
  114.  
  115. !INDEX
  116. ======
  117. Turns the 'Use index' button in the Match window ON and OFF.
  118.  
  119. !FIRST
  120. ======
  121. Followed by ON this causes any header information, such as date-stamp or
  122. title, to appear on the first page only of a report. When OFF the header is
  123. printed on every page.
  124.  
  125. !SHRINK
  126. =======
  127. Followed by ON this removes surplus "white space" between the columns of
  128. reports in Vertical format.
  129.  
  130. !HEADINGS D
  131. ===========
  132. Causes descriptors to be used as field identifiers in a report. !HEADINGS T,
  133. or without any parameter, causes tags to be used.
  134.  
  135. !PITCH <cpi>
  136. ============
  137. The parameter should be 5, 10, 12 or 17, representing double-width, pica,
  138. elite and condensed respectively.
  139.  
  140. !TITLE
  141. ======
  142. Followed by a text string causes the string to be used as a title on
  143. subsequently printed reports.
  144.  
  145. !PAGE <lines>
  146. =============
  147. Use to set the page length for reports. 70 is correct for A4, 66 for
  148. American letter.
  149.  
  150. !LINESPACE <n>
  151. ==============
  152. Sets the line-spacing to n lines. The default is 1, i.e. no blank lines
  153. between lines of report.
  154.  
  155. !LMARGIN <n>
  156. ============
  157. Sets the left margin to n character spaces
  158.  
  159. !TMARGIN <n>
  160. ============
  161. Sets the top margin to n lines
  162.  
  163. !SPACER <string>
  164. ================
  165. Specifies the string to be used to separate columns of printed data in
  166. reports using 'Horizontal' or 'Table' format.
  167.  
  168. !COLWIDTH <n>
  169. =============
  170. Sets the width of the blank columns used in 'Table' format to n spaces.
  171.  
  172. !FORMAT
  173. =======
  174. Follow this command with HORIZONTAL, VERTICAL, LABEL or TABLE. In the last
  175. case the number of columns required must be appended as a second parameter,
  176. e.g. TABLE 8.  If any other parameter is used, or !FORMAT is issued by
  177. itself, the HORIZONTAL format is used.
  178.  
  179. !DESTINATION
  180. ============
  181. Should be followed with WINDOW or FILE or PRINTER. The first causes reports
  182. to be displayed in a window, from which they may be subsequently saved. FILE
  183. causes output to be sent to a text file specified by the user. PRINTER
  184. causes output to go directly to the printer without being previously
  185. displayed or saved.
  186.  
  187. !LABEL
  188. ======
  189. This is used to define a label specification to use with the LABEL format.
  190. It requires 7 parameters, separated by commas:
  191.  
  192.     (1) The number of labels across the page (1,2 or 3)
  193.     (2) The horizontal label pitch (i.e. left edge to left edge) in inches.
  194.         This is only meaningful when (1) is 2 or 3.
  195.     (3) The vertical label pitch in inches.
  196.     (4) The number of lines to be printed on each label.
  197.     (5) The line which is to be replaced, if blank, by the last field in
  198.         the selection. If nothing is entered here (2 commas together) then
  199.         no substitution is performed.
  200.     (6) If ON is entered the the primary key will appear on the label (in
  201.         brackets) as an identifier.
  202.     (7) If ON is entered blank fields will be skipped when printing.
  203.  
  204. !DELETE <key>
  205. =============
  206. This provides a way of deleting records from the database. The parameter
  207. must be the primary key of the record. The benefits of this command may not
  208. be at all obvious. Suppose you have a text file giving details of records
  209. which must be deleted from the database. If such a job is going to occur at
  210. all often it could be worthwhile to write a customised program to read the
  211. text file and generate the primary key of each record, then output the
  212. results as a Powerbase script file. The whole batch of records can then be
  213. deleted by simply dragging the script into Powerbase. Not worthwhile for ten
  214. records, perhaps, but could be for a hundred. Note that all 6 subfiles will
  215. be searched for the records to be deleted.
  216.  
  217. !INSERT
  218. =======
  219. This is the counterpart of !DELETE and is useful in similar circumstances.
  220. In this case the command must occupy a line by itself and be followed by the
  221. record to insert, one field to a line. It is the user's responsibility to
  222. ensure that the lines are not too long for the database fields into which
  223. they are placed and that the number of lines following each !INSERT is the
  224. same as the number of fields in the record. Don't forget to leave blank
  225. lines for empty fields!                   
  226.  
  227. !IMPRESSION
  228. ===========
  229. Used in conjunction with !QUERY to generate a report in text-file format,
  230. this allows you to insert 'Impression' formatting commands at the start of
  231. the text-file. A script may, for example, execute a series of !QUERY
  232. commands and the resulting files are to be all selected together and dragged
  233. into an 'Impression' document. To make each file go into a new frame you
  234. need to make each begin with {nextframe}. This can be achieved by placing
  235. the script command !IMPRESSION {nextframe} before the first !QUERY. You do
  236. not, however, want {nextframe} to begin the first file created, or the
  237. 'Impression' document will have a blank frame on its first page. To suppress
  238. the effect on the first file use the form: !IMPRESSION {nextframe} Not
  239. first. There must be a space between the '}' and the 'N', but the 'Not
  240. first' string isn't case sensitive.
  241.  
  242.  
  243.  
  244.  
  245.