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: do endo while

Function: until
Description: until ends a do loop until the first element of the argument is true. do has to be followed by an until.


Usage: do until (cond)
Input:
cond n x 1 vector of condition

Note:

Example:

proc(j)=factorial(x)
  if (x>1)
    j=1
    do 
      j=j*x
      x=x-1
    until (x<2)
  else 
    j=x
  endif
endp

factorial(5)
Result:

Contents of j
[1,]      120 

Group: Flow Control
See also: do endo while

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

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