Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN"> |
2 | <html> | |
3 | <head> | |
4 | <title>MHonArc Resources: DEFINEVAR</title> | |
5 | </head> | |
6 | <body> | |
7 | <!--x-rc-nav--> | |
8 | <table border=0><tr valign="top"> | |
9 | <td align="left" width="50%">[Prev: <a href="definederived.html">DEFINEDERIVED</a>]</td><td><nobr>[<a href="../resources.html#definevar">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="defrcfile.html">DEFRCFILE</a>]</td></tr></table> | |
10 | <!--/x-rc-nav--> | |
11 | <hr> | |
12 | <h1>DEFINEVAR</h1> | |
13 | ||
14 | <!-- *************************************************************** --> | |
15 | <hr> | |
16 | <h2>Syntax</h2> | |
17 | ||
18 | <dl> | |
19 | ||
20 | <dt><strong>Envariable</strong></dt> | |
21 | <dd><p>N/A | |
22 | </p> | |
23 | </dd> | |
24 | ||
25 | <dt><strong>Element</strong></dt> | |
26 | <dd><p> | |
27 | <code><DEFINEVAR><br></code> | |
28 | <var>variable-name</var><br> | |
29 | <var>value ...</var><br> | |
30 | <code></DEFINEVAR><br></code> | |
31 | </p> | |
32 | </dd> | |
33 | ||
34 | <dt><strong>Command-line Option</strong></dt> | |
35 | <dd><p><br> | |
36 | <code>-definevar </code><var>variable-specification-list</var> | |
37 | </p> | |
38 | </dd> | |
39 | ||
40 | </dl> | |
41 | ||
42 | <!-- *************************************************************** --> | |
43 | <hr> | |
44 | <h2>Description</h2> | |
45 | ||
46 | <p>DEFINEVAR is used for creating user-defined resource variables. | |
47 | DEFINEVAR can be defined on the command-line or in the resource file. | |
48 | </p> | |
49 | ||
50 | <p>On the command-line, the option is called <code>-definevar</code> | |
51 | The following argument after <code>-definevar</code> | |
52 | is treated as a variable specification list. The specification list | |
53 | is a string containing name/value pairs with the following format: </p> | |
54 | ||
55 | <p><var>NAME</var><code>=</code><var>VALUE</var></p> | |
56 | ||
57 | <p>Multiple name/value pairs are separated | |
58 | by whitespace. | |
59 | If <var>VALUE</var> contains whitespace, then it must be surrounded | |
60 | by quotes to prevent the command shell from treating the string | |
61 | as multiple arguments. | |
62 | Multiple <code>-definevar</code> options can be specified on the | |
63 | command-line. This can help reduce the ugliness of specify mutliple | |
64 | variable definitions with a single option. | |
65 | </p> | |
66 | ||
67 | <table border=0 cellpadding=4> | |
68 | <tr valign=top> | |
69 | <td><strong>NOTE</strong></td> | |
70 | <td><p>If you intend to include resource variables as part of the | |
71 | <var>VALUE</var>, you may need to escape the '$' characters (and possible | |
72 | other characters) to | |
73 | prevent interpolation by the command shell. See your command | |
74 | shell documentation for more information. | |
75 | </p> | |
76 | </td> | |
77 | </tr> | |
78 | </table> | |
79 | ||
80 | <p>In a resource file the <DEFINEVAR> element may occur mutliple times | |
81 | to define multiple variables. The first line of the <DEFINEVAR> | |
82 | element is the name of the variables. All subsequent lines represent | |
83 | the content of the variable. If you do not want | |
84 | the last newline of a <DEFINEVAR> element content to be part of | |
85 | the defined | |
86 | variable content, then specify the <b><tt>chop</tt></b> attribute. | |
87 | </p> | |
88 | ||
89 | <!-- *************************************************************** --> | |
90 | <hr> | |
91 | <h2>Default Setting</h2> | |
92 | ||
93 | <p>N/A | |
94 | </p> | |
95 | ||
96 | <!-- *************************************************************** --> | |
97 | <hr> | |
98 | <h2>Resource Variables</h2> | |
99 | ||
100 | <p>N/A | |
101 | </p> | |
102 | ||
103 | <!-- *************************************************************** --> | |
104 | <hr> | |
105 | <h2>Examples</h2> | |
106 | ||
107 | <p>The following is a simple example of defining a variable to | |
108 | represent the base text for the title of an archive: | |
109 | </p> | |
110 | ||
111 | <pre> | |
112 | <b><DefineVar chop></b> | |
113 | MAIN-TITLE | |
114 | Comp.lang.perl.misc | |
115 | <b></DefineVar></b> | |
116 | </pre> | |
117 | ||
118 | <p>Now, the variable can be refernced as follows: | |
119 | </p> | |
120 | ||
121 | <pre> | |
122 | <b><<a href="ttitle.html">TTitle</a> chop></b> | |
123 | $MAIN-TITLE$ (thread) | |
124 | <b></TTitle></b> | |
125 | </pre> | |
126 | ||
127 | <p>If you wanted to use the same resource file for multiple arcvhives | |
128 | it may better to define <code>$MAIN-TITLE$</code> on the command-line | |
129 | as follows: | |
130 | </p> | |
131 | ||
132 | <pre> | |
133 | % <b>mhonarc -definevar MAIN-TITLE='mhonarc mailing list'</b> ... | |
134 | </pre> | |
135 | ||
136 | <!-- *************************************************************** --> | |
137 | <hr> | |
138 | <h2>Version</h2> | |
139 | ||
140 | <p>2.0 | |
141 | </p> | |
142 | ||
143 | <!-- *************************************************************** --> | |
144 | <hr> | |
145 | <h2>See Also</h2> | |
146 | ||
147 | <p> | |
148 | </p> | |
149 | ||
150 | <!-- *************************************************************** --> | |
151 | <hr> | |
152 | <!--x-rc-nav--> | |
153 | <table border=0><tr valign="top"> | |
154 | <td align="left" width="50%">[Prev: <a href="definederived.html">DEFINEDERIVED</a>]</td><td><nobr>[<a href="../resources.html#definevar">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="defrcfile.html">DEFRCFILE</a>]</td></tr></table> | |
155 | <!--/x-rc-nav--> | |
156 | <hr> | |
157 | <address> | |
158 | $Date: 2002/07/27 05:13:10 $ <br> | |
159 | <img align="top" src="../monicon.png" alt=""> | |
160 | <a href="http://www.mhonarc.org/"><strong>MHonArc</strong></a><br> | |
161 | Copyright © 1997-1998, <a href="http://www.earlhood.com/">Earl Hood</a>, <a href="mailto:mhonarc@mhonarc.org">mhonarc@mhonarc.org</a><br> | |
162 | </address> | |
163 | ||
164 | </body> | |
165 | </html> |