Group: | Flow Control |
See also: | do endo until |
Function: | while | |
Description: |
while begins a loop if the first element of the argument is true. while has to be followed by an endo.
|
Usage: | while (cond) | |
Input: | ||
cond | n x 1 vector of condition |
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)
Contents of j [1,] 120
Group: | Flow Control |
See also: | do endo until |