home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / textutil / jgpsuite / xmp / EXALIEN next >
Encoding:
Text File  |  1992-09-06  |  11.9 KB  |  273 lines

  1. .setu 10 :arc:
  2. .setm 1 *
  3. .nost
  4. !\t\s1 \t}*                     for undentation, see below
  5. .setend : } :
  6. .makel dent                     indented layout
  7. .setend : ]:
  8. .makel meta                     discussion layout
  9. .setend ::
  10. .ht 7 12
  11. .setst :\h2:
  12. .makel list                     listing layout
  13. .setst ::
  14. .setc A.1
  15. .hd
  16. /
  17. .if \o
  18. .col
  19. Page \p|Notes|\s0
  20. .else
  21. .col
  22. \s0|Notes|Page \p
  23. .fi
  24.  
  25. /
  26. .ft
  27. :
  28.  
  29. .col
  30. 30/11/87|(C) JGLaski, 1988|AL2/8/88
  31.  
  32. :
  33. One inconvenience I have found with some software packages is that the screen
  34. dialogue etc. has been designed for a foreign culture to my own. I therefore
  35. kept in mind, during development of JGPrint, the desirability of enabling a
  36. JGPrint user to reformulate for her colleagues the various messages JGPrint
  37. provides; this must, of course be tempered by the need to keep things simple
  38. and efficient behind the scenes. Future plans include giving JGEd an analogous
  39. internationalism.
  40.  
  41. Therefore, while developing JGPrint, I separated the code from the strings
  42. used by JGprint in its dialogue with the user; the characters with which the
  43. user is to respond are taken to be the head of strings used mostly to specify
  44. buttons in the desktop reports. I also separated from the code the actual
  45. strings used in the dotty directives. I have thus built in access to what was
  46. first conceived as a development tool to enable an 'alien' JGPrint with
  47. substantially non\-English dialogue to be constructed if required.
  48.  
  49. The file containing these is
  50. .if \u10 eq arc
  51.  JGPstrings
  52. .else
  53.  JGPSTRS.CHR
  54. .fi
  55.  and each string is indexed by a name such as strc.55 that helps me with
  56. maintenance, but is not used by JGPrint.
  57.  
  58. I would advise against attempting this operation without backing this file up
  59. very securely indeed under some suitable name; it is most unlikely that you will
  60. get what you want the first time you try. Moreover, to test thoughrouly you will
  61. have to construct mini\-JGPrint examples to throw up a sufficient subset of
  62. complaints for you to feel safe.
  63.  
  64. Since what follows requires extensive use of .SET(ST/END) and undented
  65. (hanging indent) lines, I decided to combine the main discussion with a
  66. discussion of startstrings and endstrings; I have even shown a right undent,
  67. an available facility that, frankly, I have not yet found a genuine practical
  68. use for.
  69.  
  70. .pushl meta
  71. This example text shows how .setend can be used to mark lines, as these are
  72. marked with ']'. Any text that discusses this use is so marked. .setst with a
  73. tab as the startstring can, in association with .nost, be used for left
  74. undentation, and any discussion of this will be marked with a '}' on the
  75. right. A left '[' is now set.
  76. .setst : [:
  77. \ \ \|
  78. aa\w\w\|
  79. .bar .
  80.  
  81. .col
  82. This is|a dot colled|line
  83. As will be seen from the previous three lines, a .bar line, an empty line and
  84. a .col line are not bracketted by this mechanism; the two lines preceeding
  85. these show two different devices to obtain a blank bracketted line. To save
  86. you going to the source text, they are:
  87. .hln
  88. .col
  89. |\\ \\ \\ \\||;|
  90. .col
  91. | aa\\w\\w\\||.|
  92. .hln
  93. The first works by making a line consisting of a word of two hard spaces; the
  94. second by fooling the readword routine to put out an empty word by giving it
  95. two 'a's and then wiping them out with two '\\w'. The first uses fewer
  96. keystrokes but the second, I think, is more elegant.
  97.  
  98. In writing the preceeding paragraph, I had a genuine need, for the first time,
  99. to use a '|' within a .COL; this gives me hope that in two or three years
  100. time, I will suddenly find a need for a right undent (see above).
  101.  
  102. .noend
  103. Here is a demonstration of the use of .noend to produce a right\-undented
  104. line. As I have said, I don't know of a genuine use for it; I shall be glad to
  105. hear from any user who has one.
  106. .popl
  107.  
  108. .cp 12
  109. The files used to incorporate alienstrings provide 2 groups of information:
  110.  
  111. \t\s2 \t}strings used in JGPrint;
  112. .hln
  113. \t\s2 \t}Dotty words to be recognised in the text.
  114.  
  115. These groups are separated by one or more blank lines. The string group must
  116. not contain blank lines. Each line contains one string terminated by a space,
  117. and followed by comments. See below for more detailed discussion.
  118.  
  119. The Dotty words are separated by either spaces or a newline; comments cannot
  120. be interspersed.
  121.  
  122. There are certain restrictions on the flexibility provided:
  123. .pushl list
  124.  
  125. .nost
  126. ! \t\s1=1 \h2.The Copyright messages cannot be changed since I have
  127. forbidden it, and "JGPStrings missing" and "not enough space" because they are
  128. encountered before the messages are read in.
  129.  
  130. .nost
  131. ! \t\s1 \h2.Certain strings 'wrap around' others using %s as described below.
  132. Where these enclosing strings are just spaces, newlines and punctuation, they
  133. have not been made available for changes.
  134.  
  135. \u1Certain strings are needed, if needed, before the JGPStrings has been read
  136. in; these cannot therefore be supplied by JGPStrings.
  137.  
  138. \u1Certain strings are the result of recent developments. I prefer to keep
  139. these out of the changing mechanism until they have settled down, and
  140. experience has shown that they are best placed and best formulated.
  141.  
  142. \u1The most important restriction, however, concerns the inclusion of values
  143. within the string, by using the percentage escapers %s(tring), %c(haracter) or
  144. %n(umber). For discussion of their meaning, see below. It is essential that
  145. any string the user provides as an alternative contains precisely the same
  146. sequence of %-escape characters. More precisely, no more than the same number
  147. of these as exists in the corresponding string in the original file should be
  148. included, and, in particular, a use of %s in an incorrect position will
  149. produce garbage on screen, and can cause serious inconvenience.
  150.  
  151. \u1*n, which stands for newline, should almost certainly be kept in similar
  152. positions in corresponding strings, in order to keep to the layout of the
  153. lines on the screen.
  154.  
  155. .usel dent
  156. The preceeding list is laid out to demonstrate left\-undenting. The text is
  157. justified between a left margin indented 12 characters and the standard right
  158. margin. The first line is undented, with '!' at the left margin, and with the
  159. section number (letter) in the 7th character position. This is more complicated
  160. than is usually needed, but shows what can be done, and from which a subset
  161. can be chosen according to any particular need.
  162.  
  163. It is effected by first setting tab stops at character positions 7 and 12 by
  164. the directive .ht 7 12 <nl>. The directive .setst :\\h2: then sets an 11
  165. character startstring to effect the indentation. The use of this directive
  166. forces, if required, a newline at the end of the preceeding text. To cancel
  167. the indentation, set a null startstring by .setst ::. This too may force a
  168. newline.
  169.  
  170. ..nost is weaker than .setst ::. It cancels the startstring just for the
  171. immediately following line (after, possibly, forcing a newline); the
  172. indentation of the letters is simply achieved by putting in the tab \\t.
  173. As used here, this enables numbered points to be pleasantly laid out; some
  174. systems, perhaps observing particular users (eg. the UK Civil Service),
  175. identify section numbering, which to me is a matter of content, with starting
  176. a new paragraph, which to me is a matter of form. JGPrint's system provides
  177. the flexibility to keep the two facilities separate; those who disagree with
  178. me can easily practice their rigid rules.
  179.  
  180. The directives needed to arrange undenting and numbering and aligning the
  181. first word of the line with the indented text are somewhat fiddly, so, after
  182. the first use, which was slightly special in that it needed to reset section
  183. numbering, and the second which I left to show explicitly the full details, I
  184. used \\u1, a user string that I had defined for this purpose. Here it is:-
  185. .hln
  186. ..setm 1 /
  187. ..nost/
  188. !\\t\\s1 \\t}/
  189. .hln
  190. I normally put such a definition in the prologue, and therefore use a .SETM; a
  191. ..SETU would have interpreted the tabs at the point of definition. Since they
  192. were not yet defined, there would, I trust, have been a diagnostic! More
  193. seriously, the tabs are required not to be put into effect until they are
  194. reached when interpreting the line.
  195.  
  196. Notice also the use of .popl to return to the base layout, even though we have
  197. left the layout originally pushed onto the stack. Had the directive for dent
  198. been .pushl dent, we would have had to use two .POPLs to get back to the
  199. original layout.
  200.  
  201. .popl
  202. .col
  203. |The syntax of the strings
  204.  
  205. Strings can force the incorporation of additional parameters by the use of the
  206. percentage escapers. Thus, for example, the prompt "Configured for 's'
  207. OK('c')? :", is supplied by JGPrint with a string parameter, e.g. "Screen"
  208. found from within the configuration file, and a character parameter, e.g. 'Y'
  209. found as the head of a certain other string.
  210.  
  211. The string supplied must contain markers, \U}viz\V %s and %c, where, in the
  212. description above, 's' and 'c' were used, to force these supplied parameters
  213. to be included. Any occurrence of % in a string will assume that this
  214. is a marker for some kind of inclusion, and that the next character will
  215. specify what kind. At present, and, indeed, for the forseeable future, these
  216. are just S/s for strings, C/c for characters and N/n for (decimal) numbers. If
  217. the next character is not one of these the '%' is ignored, and the next
  218. character printed. In practice, this means that to get a '%' printed, two '%'s
  219. must be put into the string. The similarity of these rules to those governing
  220. the provision of codestrings for printers in the configuration file should be
  221. noted.
  222.  
  223. One string per line is taken in, and, roughly speaking, the string found on
  224. the nth. line will be the one supplied as JGPrint calls for the nth. string.
  225. Therefore, precisely the same number of lines as are found in JGPstrings must
  226. be provided in any alternative <stringfile> supplied. An empty line is
  227. unacceptable. Use a single character if you want to save space.
  228.  
  229. Any space characters at the beginning of a line are gobbled, and characters
  230. are then read into a string until a space or newline is encountered; any
  231. characters following this space are ignored, and can be used, as 'str?.??' are
  232. in JGPStrings, for comments. (These I use to help me maintain JGPrint, but
  233. if I were producing a <stringfile> to replace JGPStrings, which I did not
  234. need for maintenance, I might use the strings of the original JGPStrings as
  235. comments.) These rules present a problem as to how to put spaces and newlines
  236. into the strings, and '*' is used as an escape character with *s signifying
  237. space and *n newline. Thus the example above is actually supplied as:-
  238. .hln
  239. .col
  240. |Configured*sfor*s%s*nOK?(%c)?*s:
  241. .hln
  242. Notice that no quotation marks should be supplied; if they occur, they will be
  243. incorporated verbatim. (BCPL afficionados should note that no other *<escape>
  244. codes are provided.) In the event that strings are included in a diagnostic
  245. report (see below), *s and *n will have been translated into space and
  246. newline.
  247.  
  248. .col
  249. |The size of strings and Diagnostics
  250.  
  251. JGPrint begins by reading in JGPStrings, and putting the strings and the dotties
  252. in space provided for them, setting up, on the way, various internal
  253. data\-structures.
  254.  
  255. JGPrint knows how many strings, and dotties to expect, and if the file
  256. JGPStrings has a mismatch, it will report, say, using strd.96,
  257. .col
  258. |*n%n*sstrings*ssupplied.*s%n*srequired
  259. that some strings are missing, or, whatever I have judged to be a suitably
  260. informative message, and abandon the run.
  261.  
  262. If JGPStrings is edited to begin with a '.', various diagnostics are provided to
  263. confirm that the strings are being correctly read in.
  264.  
  265. For historical reasons, JGPrint provides space within the code for the strings
  266. read in. For this reason, the strings could have too many characters to fit,
  267. and, if so, a "too many characters" report is provided, which includes an
  268. indication of whereabouts in the strings this overflow occurs. This will appear
  269. whether or not the '.' for diagnostics was set.
  270.  
  271.  
  272.  
  273.