Next: ischar()
Up: MacAnova Help File
Previous: ipf()
Contents
Usage:
isarray(arg1 [,arg2, ...] [,real:T, logic:T, char:T, integer:T,\
positive:T, negative:T, nonneg:T])
|
Keywords:
macros, general, variables
isarray(arg) returns True if arg is an array of any type, REAL, LOGICAL,
CHARACTER or LONG, and False otherwise. If arg is undefined, isarray()
returns False.
isarray(arg,real:T) returns True if and only if arg is a REAL array.
Similarly isarray(arg,char:T) and isarray(arg,logic:T) return True
only if arg is a array of the specified type. You can specify more
than one acceptable type; for example, isarray(arg,real:T,logic:T)
returns True only if arg is a REAL or LOGICAL array.
isarray(arg, integer:T), isarray(arg, positive:T), isarray(arg,
negative:T) and isarray(arg, nonneg:T) are similar, testing that arg is
a REAL array whose value has the specified property. You can use
'integer:T' with any of 'positive:T', 'negative:T' and 'nonneg:T'. You
cannot use 'char:T' or 'logic:T' with these keywords.
isarray(arg1, arg2, ..., argk [,keywords]) returns a LOGICAL vector,
each element of which is True or False depending on whether or not the
corresponding argument is a array with the properties, if any, specified
by keyword phrases.
The principal use of isarray() is in checking the arguments of a macro
for appropriateness. See argvalue() for another way to check for the
properties of macro arguments.
Examples:
Cmd> isarray(vector(x), matrix(x,4), array(x,2,2,2), structure(x))
has value vector(T,T,T,F) when x has 8 elements.
In a macro
if (!isarray($1,real:T,logic:T)){
error("$1 is not a REAL or LOGICAL")
}
ensures argument 1 is REAL or LOGICAL before proceeding.
See also array(), error(), ischar(), isdefined(), isfactor(),
isfunction(), isgraph(), islogic(), ismacro(), ismatrix(), isname(),
isnumber(), isnull(), isreal(), isscalar(), isstruc(), isvector().
Gary Oehlert
2003-01-15