Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / doc / MHonArc / resources / definevar.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN">
<html>
<head>
<title>MHonArc Resources: DEFINEVAR</title>
</head>
<body>
<!--x-rc-nav-->
<table border=0><tr valign="top">
<td align="left" width="50%">[Prev:&nbsp;<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:&nbsp;<a href="defrcfile.html">DEFRCFILE</a>]</td></tr></table>
<!--/x-rc-nav-->
<hr>
<h1>DEFINEVAR</h1>
<!-- *************************************************************** -->
<hr>
<h2>Syntax</h2>
<dl>
<dt><strong>Envariable</strong></dt>
<dd><p>N/A
</p>
</dd>
<dt><strong>Element</strong></dt>
<dd><p>
<code>&lt;DEFINEVAR&gt;<br></code>
<var>variable-name</var><br>
<var>value ...</var><br>
<code>&lt;/DEFINEVAR&gt;<br></code>
</p>
</dd>
<dt><strong>Command-line Option</strong></dt>
<dd><p><br>
<code>-definevar </code><var>variable-specification-list</var>
</p>
</dd>
</dl>
<!-- *************************************************************** -->
<hr>
<h2>Description</h2>
<p>DEFINEVAR is used for creating user-defined resource variables.
DEFINEVAR can be defined on the command-line or in the resource file.
</p>
<p>On the command-line, the option is called <code>-definevar</code>
The following argument after <code>-definevar</code>
is treated as a variable specification list. The specification list
is a string containing name/value pairs with the following format: </p>
<p><var>NAME</var><code>=</code><var>VALUE</var></p>
<p>Multiple name/value pairs are separated
by whitespace.
If <var>VALUE</var> contains whitespace, then it must be surrounded
by quotes to prevent the command shell from treating the string
as multiple arguments.
Multiple <code>-definevar</code> options can be specified on the
command-line. This can help reduce the ugliness of specify mutliple
variable definitions with a single option.
</p>
<table border=0 cellpadding=4>
<tr valign=top>
<td><strong>NOTE</strong></td>
<td><p>If you intend to include resource variables as part of the
<var>VALUE</var>, you may need to escape the '$' characters (and possible
other characters) to
prevent interpolation by the command shell. See your command
shell documentation for more information.
</p>
</td>
</tr>
</table>
<p>In a resource file the &lt;DEFINEVAR&gt; element may occur mutliple times
to define multiple variables. The first line of the &lt;DEFINEVAR&gt;
element is the name of the variables. All subsequent lines represent
the content of the variable. If you do not want
the last newline of a &lt;DEFINEVAR&gt; element content to be part of
the defined
variable content, then specify the <b><tt>chop</tt></b> attribute.
</p>
<!-- *************************************************************** -->
<hr>
<h2>Default Setting</h2>
<p>N/A
</p>
<!-- *************************************************************** -->
<hr>
<h2>Resource Variables</h2>
<p>N/A
</p>
<!-- *************************************************************** -->
<hr>
<h2>Examples</h2>
<p>The following is a simple example of defining a variable to
represent the base text for the title of an archive:
</p>
<pre>
<b>&lt;DefineVar chop&gt;</b>
MAIN-TITLE
Comp.lang.perl.misc
<b>&lt;/DefineVar&gt;</b>
</pre>
<p>Now, the variable can be refernced as follows:
</p>
<pre>
<b>&lt;<a href="ttitle.html">TTitle</a> chop&gt;</b>
$MAIN-TITLE$ (thread)
<b>&lt;/TTitle&gt;</b>
</pre>
<p>If you wanted to use the same resource file for multiple arcvhives
it may better to define <code>$MAIN-TITLE$</code> on the command-line
as follows:
</p>
<pre>
% <b>mhonarc -definevar MAIN-TITLE='mhonarc mailing list'</b> ...
</pre>
<!-- *************************************************************** -->
<hr>
<h2>Version</h2>
<p>2.0
</p>
<!-- *************************************************************** -->
<hr>
<h2>See Also</h2>
<p>
</p>
<!-- *************************************************************** -->
<hr>
<!--x-rc-nav-->
<table border=0><tr valign="top">
<td align="left" width="50%">[Prev:&nbsp;<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:&nbsp;<a href="defrcfile.html">DEFRCFILE</a>]</td></tr></table>
<!--/x-rc-nav-->
<hr>
<address>
$Date: 2002/07/27 05:13:10 $ <br>
<img align="top" src="../monicon.png" alt="">
<a href="http://www.mhonarc.org/"><strong>MHonArc</strong></a><br>
Copyright &#169; 1997-1998, <a href="http://www.earlhood.com/">Earl Hood</a>, <a href="mailto:mhonarc@mhonarc.org">mhonarc@mhonarc.org</a><br>
</address>
</body>
</html>