change boolean = single string to an error
This commit is contained in:
@ -198,8 +198,9 @@ FALSE.
|
||||
.. note::
|
||||
|
||||
If the Boolean expression is a single numeric value with no Boolean
|
||||
operators, it will be FALSE if the value = 0.0, otherwise TRUE. If the
|
||||
Boolean expression is a single string, it will always be FALSE.
|
||||
operators, it will be FALSE if the value = 0.0, otherwise TRUE. If
|
||||
the Boolean expression is a single string, an error message will be
|
||||
issued.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -4857,8 +4857,11 @@ double Variable::evaluate_boolean(char *str)
|
||||
if (nargstack != 1) error->all(FLERR,"Invalid Boolean syntax in if command");
|
||||
|
||||
// if flag == 1, Boolean expression was a single string with no operator
|
||||
// error b/c invalid, only single number with no operator is allowed
|
||||
|
||||
if (argstack[0].flag == 1)
|
||||
error->all(FLERR,"If command boolean cannot be single string");
|
||||
|
||||
if (argstack[0].flag == 1) return 0.0;
|
||||
return argstack[0].value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user