<! banner_id > The built-in macro <code>DEFINECHARTABLE</code> defines a character translation table. It takes two parameter lists: the name of the table and the character translations. Hence, each table is defined by its own name. As an example of a table, consider the following fragment. It defines a table that translates the upper case characters <code>A</code> to <code>E</code> to their lower case equivalents: <pre> DEFINECHARTABLE(tolower)( 'A' = "a" 'B' = "b" 'C' = "c" 'D' = "d" 'E' = "e" ) </pre> <p>Each <code>DEFINECHARTABLE</code> statement <strong>must</strong> have a non-empty second parameter. "Empty" character tables cannot be defined, though one non-translation table is built-in. <p>The syntaxis of the second parameter list is as follows: <p><dl> <p><li > On separate lines, input characters are mapped to a sequence to appear on the output. <p><li > Per line, the input character is specified as <code>'c'</code>, <code>c</code> being any character. Escape-sequences from the <strong>C</strong> programming language can be used in this specification; Yodl supports the sequences <code>\a</code> (alert), <code>\b</code> (beep), <code>\f</code> (formfeed), <code>\n</code> (newline), <code>\r</code> (carriage return), <code>\t</code> (tab), and <code>\v</code> (vertical tab). Any other character following a \ defines itself: <code>\\</code> defines one backslash character. <p><li > Following the character specification, a <code>=</code> must appear. <p><li > Following that, a sequence of one or more characters appears, enclosed in double quotes, defining the translation. Again, escape sequences can be used, as in: <p><pre> '\n' = "End of line\n" </pre> <p>Such a mapping adds the text <code>End of line</code> to each line, since each newline character in the input is replaced by the text <code>End of line</code>, followed by the newline itself. <p></dl> <p>Translations which are <strong>not</strong> specified in the table are left to the default, which is to output the character as-is. <p>Note that the character table translation is something that the <code>yodl</code> program does as one of its last actions, just before sending text to the output file. The expansion text is not further processed by <code>yodl</code>, except for the conversion of <strong>C</strong>-type escape sequences to ordinary characters. The expansion text should therefore not be protected by, e.g., <code>NOTRANS</code> (unless of course you want some character to generate the text <code>NOTRANS</code> on the output). <!-- if this file ./Documentation/footer.html.in is present, it is included automatically by add-html-footer, and replaces the simple standard footer substitutions: * index, * package name * package name * ENV:WEBMASTER, * ENV:WEBMASTER --> <hr> Go <a href=>back</a> to index of Yodl. <p> Please send Yodl questions and comments to <a href="mailto:yodl@icce.rug.nl"> <em>yodl@icce.rug.nl</em></a>. <p> <!-- package Yodl Yodl --> Please send comments on these web pages to <a href="mailto:(address unknown)"><em>(address unknown)</em></a> <p> Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen. <p> Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.<p> <hr><font size=-1> This page was built from Yodl-1.31.18 by <address><br> <<a href=\"mailto:(address unknown)\">(address unknown)</a>>, Wed Mar 5 04:36:20 2008 EST.</address><p></font></BODY> </html>