User Tools

Site Tools


jvs:fscan:manual:chapter2:if

This is an old revision of the document!


fScan Reference Manual, Chapter 2 (CmdLineOptions): if

If -- Test some condition before executing commands

usage: -if EXPR { COMMANDS }
or: -if ! EXPR { COMMANDS }

The EXPR argument to IF must be an expression that will yield a numerical value.

If EXPR > 0, the COMMANDS string inside the curly brackets will be executed next.
If EXPR ⇐ 0, the COMMANDS string will be ignored.

EXPR can be a single number, an arithmetic expression, or a status query. The EXPR argument must not contain any spaces within it. Examples of valid EXPR arguments are:

$xdim                - data set image width
?taskname            - query whether the TASKNAME variable is set for the current data set
$zdim-30             - true if there more than 30 slices (ZDIM)
exists(param.tmp)    - true if file "param.tmp" exists

If '!' appears before the EXPR argument, the IF condition is true if EXPR is 0.
Note: the '!' must be separated from IF and EXPR by spaces.

See Also:
fScan Home, fScan Manual, CmdLineOptions, Manual Help

jvs/fscan/manual/chapter2/if.1301582953.txt.gz · Last modified: 2014/08/04 16:03 (external edit)