From 82897a55abff002931ba618d68247e46a6e2625c Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 9 Jan 2014 18:29:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11209 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Section_commands.html | 33 +++++++++++++++++++++++---------- doc/Section_commands.txt | 31 ++++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/doc/Section_commands.html b/doc/Section_commands.html index 02f92867c0..5634db2a01 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -100,19 +100,27 @@ single leading "#" will comment out the entire command.

(3) The line is searched repeatedly for $ characters, which indicate variables that are replaced with a text string. See an exception in -(6). +(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". +"x".

-

If the $ is followed by parenthesis, then the text inside the -parenthesis is treated as an "immediate" variable and evaluated as an -equal-style variable. 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: +

How the variable is converted to a text string depends on what style +of variable it is; see the variable doc page for details. +It can be a variable that stores multiple text strings, and return one +of them. The returned text string can be multiple "words" (space +separated) which will then be interpreted as multiple arguments in the +input command. The variable can also store a numeric formula which +will be evaluated and its numeric result returned as a string. +

+

As a special case, if the $ is followed by parenthesis, then the text +inside the parenthesis is treated as an "immediate" variable and +evaluated as an equal-style variable. 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:

variable X equal (xlo+xhi)/2+sqrt(v_area)
 region 1 block $X 2 INF INF EDGE EDGE
@@ -148,14 +156,19 @@ underscores, or punctuation characters.
 line are arguments.
 

(6) If you want text with spaces to be treated as a single argument, -it can be enclosed in either double or single quotes. E.g. +it can be enclosed in either double or single quotes. A long single +argument enclosed in quotes can even span multiple lines if the "&" +character is used, as described above. E.g.

print "Volume = $v"
-print 'Volume = $v' 
+print 'Volume = $v'
+variable a string "red green blue &
+                   purple orange cyan"
 if "$steps > 1000" then quit 
 

The quotes are removed when the single argument is stored internally. -See the dump modify format or print or +

+

See the dump modify format or print or if 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). diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index 9d33212365..92f05d1aed 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -96,19 +96,27 @@ single leading "#" will comment out the entire command. (3) The line is searched repeatedly for $ characters, which indicate variables that are replaced with a text string. See an exception in -(6). +(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". +"x". -If the $ is followed by parenthesis, then the text inside the -parenthesis is treated as an "immediate" variable and evaluated as an -"equal-style variable"_variable.html. 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: +How the variable is converted to a text string depends on what style +of variable it is; see the "variable"_variable doc page for details. +It can be a variable that stores multiple text strings, and return one +of them. The returned text string can be multiple "words" (space +separated) which will then be interpreted as multiple arguments in the +input command. The variable can also store a numeric formula which +will be evaluated and its numeric result returned as a string. + +As a special case, if the $ is followed by parenthesis, then the text +inside the parenthesis is treated as an "immediate" variable and +evaluated as an "equal-style variable"_variable.html. 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: variable X equal (xlo+xhi)/2+sqrt(v_area) region 1 block $X 2 INF INF EDGE EDGE @@ -144,13 +152,18 @@ underscores, or punctuation characters. line are arguments. (6) If you want text with spaces to be treated as a single argument, -it can be enclosed in either double or single quotes. E.g. +it can be enclosed in either double or single quotes. A long single +argument enclosed in quotes can even span multiple lines if the "&" +character is used, as described above. E.g. print "Volume = $v" -print 'Volume = $v' +print 'Volume = $v' +variable a string "red green blue & + purple orange cyan" if "${steps} > 1000" then quit :pre The quotes are removed when the single argument is stored internally. + See the "dump modify format"_dump_modify.html or "print"_print.html or "if"_if.html commands for examples. A "#" or "$" character that is between quotes will not be treated as a comment indicator in (2) or