IF command documentation

Hello LAMMPS users & Developers,

I’m writing this email about documentation page of “if" command. I think, in the docs it will be more user friendly by explicitly mentioning about putting Boolean expression within quotes. I can see that for commands to be executed later on but for the Boolean expression it’s only given in the examples, not mentioned in the syntax of the commend. Just thought it will be helpful to new users like me.

Thank you.

Hello LAMMPS users & Developers,

I’m writing this email about documentation page of “if" command. I think, in
the docs it will be more user friendly by explicitly mentioning about
putting Boolean expression within quotes. I can see that for commands to be
executed later on but for the Boolean expression it’s only given in the
examples, not mentioned in the syntax of the commend. Just thought it will
be helpful to new users like me.

near that statement, it says that the syntax of the booleans is
explained below. and further down you'll see:

Note that each expression is a single argument within the if command.
Thus if you want to include spaces in the expression for clarity, you
must enclose the entire expression in quotes.

so actually quotes are *not* required, only if there are spaces in the
boolean expression. thus this will work, too.

if 2==1 then "variable t equal 5" else "variable t equal 10"
print "$t"
10

as with all kinds of documentation. the answer is often there, but it
may require that you look at it with more care or check it multiple
times.