Next: anova()
Up: MacAnova Help File
Previous: addstrings()
Contents
Usage:
alltrue(arg1,arg2,...,argm), all arguments LOGICAL scalars
|
Keywords:
logical variables, syntax
alltrue(a1,a2,...,aM) is equivalent to a1 && a2 && ... && aM, except
that no arguments are evaluated unnecessarily, that is, it evaluates no
arguments after the first false one. All arguments must be LOGICAL
scalars.
Example:
if(!alltrue(isscalar(x,real:T),x > 0, x == floor(x))){
error("x is not positive integer")
}
The apparently more natural way to do the same thing
if(!(isscalar(x,real:T) && x > 0 && x == floor(x))){
error("x is not positive integer")
}
would not do what you want for a non-REAL x since an attempt would be
made to evaluate floor(x), which is illegal for non-REALs.
See also topics 'logic', anytrue().
Gary Oehlert
2003-01-15