Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Group: Flow Control
See also: else endif

Function: if
Description: if does conditional branching, if the first element of the argument is true. If has to be followed by an endif. Else is an optional part of if sequences.

Usage: if (cond) <xplore commands> {else <xplore commands>} endif
Input:
cond n-dimensional array of condition

Note:

Example:
proc(y)=abso(x)
  if(x<0)
    y=-1.0*x
  else
    y=x
  endif
endp
abso(-eh)

Result:
Contents of y

[1,]   2.7183
Example:
proc(y)=null(x)
  if(x=0)
    y=1
  else
    y=0
  endif
endp
null(eh)

Result:
Syntax Error
in null line: 3
Parse Error
on position 6 in line 3



(C) MD*TECH Method and Data Technologies, 05.02.2006