Title | Previous | Next

if

A conditional statement.

Synopsis:

if ( expression ) ( command )

if ( expression ) ( command ) [ ( command ) ... ( command ) ]

Arguments:

expression

Anything which can be evaluated. Commonly, this might be something like defined "isovar" , which is true if isovar is a command, function, or alias.

command

Any valid MeshTV command, or sequence of commands if you use the progn command

Description:

The if command takes an expression and a command to evaluate if the condition is true. Additional commands are evaluated if the expression is false. This is used when you are programming your own aliases.

Examples:

if (defined "isovar") (plot isovar) (plot d)

if (defined "isovar") (progn (delete iso1) (plot isovar))

# The following example is read from an init file.

alias command=yes plv " \

if (defined \"vec_ppp\") \

(error \"The vector plot is already plotted.\") \

(progn \

(delete_vec) \

(alias \"vec_ppp\" yes) \

(set_vec_symm) \

(vec var=$1) \

(plot_vec)) \

";

See Also:

alias , defined , error , progn


Title | Previous | Next

MeshTV@viper.llnl.gov
Copyright © 1998, U.S. Department of Energy. All rights reserved.