@node If, Image, Identification, Commands @iftex @syntax If. @end iftex @example Syntax: IF ( expr ) @{ list @} IF ( expr ) @{ list @} ELSE @{ list @} @end example @pindex If If the @code{expr} is true (non-zero), then the @code{list } of commands are executed, otherwise the @code{ELSE} clause is executed. For various complicated reasons, the @code{ELSE}less command must end with a newline (or as usual a \n) (@pxref{Loops and If}). One common use for IF tests is when the expression tests if a variable has been defined, e.g. @example IF($?file_name == 0) @{ DEFINE file_name ? @} @end example @noindent within some macro. Note that you can write IF-ELSE IF-ELSE blocks as @example if('Robert' == 'Patricia') @{ echo Something's wrong @} else @{ if('Patricia' == 'Ralph') @{ echo Still wrong @} else @{ echo Go Yankees @}@} @end example @noindent There are also commands using IF to define vectors conditionally (see SET), and to plot parts of vectors (See CONNECT, HISTOGRAM, POINTS).