git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9525 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2013-02-18 17:23:22 +00:00
parent f24bd36fe5
commit c3091aeaac
6 changed files with 97 additions and 39 deletions

View File

@ -100,13 +100,34 @@ single leading "#" will comment out the entire command.
</P>
<P>(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6). If the $ is followed by curly brackets, then the variable name
is the text inside the curly brackets. If no curly brackets follow
the $, then the variable name is the single character immediately
following the $. Thus ${myTemp} and $x refer to variable names
"myTemp" and "x". See the <A HREF = "variable.html">variable</A> command for
details of how strings are assigned to variables and how they are
substituted for in input script commands.
(6).
</P>
<P>If the $ is followed by curly brackets, then the variable name is the
text inside the curly brackets. If no curly brackets follow the $,
then the variable name is the single character immediately following
the $. Thus ${myTemp} and $x refer to variable names "myTemp" and
"x".
</P>
<P>If the $ is followed by parenthesis, then the text inside the
parenthesis is treated as an "immediate" variable and evaluated as an
<A HREF = "variable.html">equal-style variable</A>. This is a way to use numeric
formulas in an input script without having to assign them to variable
names. For example, these 3 input script lines:
</P>
<PRE>variable X equal (xlo+xhi)/2+sqrt(v_area)
region 1 block $X 2 INF INF EDGE EDGE
variable X delete
</PRE>
<P>can be replaced by
</P>
<PRE>region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
</PRE>
<P>The latter produces an identical result, without having to define and
discard a temporary variable X.
</P>
<P>See the <A HREF = "variable.html">variable</A> command for more details of how
strings are assigned to variables and evaluated, and how they can be
used in input script commands.
</P>
<P>(4) The line is broken into "words" separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
@ -120,12 +141,13 @@ it can be enclosed in either double or single quotes. E.g.
</P>
<PRE>print "Volume = $v"
print 'Volume = $v'
if "$<I>steps</I> > 1000" then quit
</PRE>
<P>The quotes are removed when the single argument is stored internally.
See the <A HREF = "dump_modify.html">dump modify format</A> or <A HREF = "if.html">if</A> commands
for examples. A "#" or "$" character that is between quotes will not
be treated as a comment indicator in (2) or substituted for as a
variable in (3).
See the <A HREF = "dump_modify.html">dump modify format</A> or <A HREF = "print.html">print</A> or
<A HREF = "if.html">if</A> commands for examples. A "#" or "$" character that is
between quotes will not be treated as a comment indicator in (2) or
substituted for as a variable in (3).
</P>
<P>IMPORTANT NOTE: If the argument is itself a command that requires a
quoted argument (e.g. using a <A HREF = "print.html">print</A> command as part of an