Next: isreal() Up: MacAnova Help File Previous: isnull()   Contents

isnumber()

Usage:
isnumber(arg1 [, arg2, ... ]), arg1, ... CHARACTER scalars



Keywords: macros, general, variables
isnumber(arg) returns T if arg is a CHARACTER scalar or quoted string
such as "-3.1416" which represents a non-MISSING number.  It is an error
if arg is not a CHARACTER scalar.  It returns F when arg does not
represent a non-MISSING number, for example "MacAnova" or "?".  See
topic 'number' for information on what are legal numbers.

isnumber() (with no argument) is legal and returns F.

isnumber(arg1, ..., argk), where the arguments are either CHARACTER
scalars or empty returns a LOGICAL vector of length k with element j
being True if and only if argument k is a CHARACTER scalar which
represents a non-MISSING number.

It is legal for an argument to be missing.  For example, a <- isnumber()
sets a to F and a <- isnumber("3.14",,"henry") sets a to vector(T,F,F).

The principal use of isnumber() is in checking the arguments of a macro
for appropriateness.

Examples:
 isnumber("3.14") returns T
 isnumber(3.14) is an error, argument is not CHARACTER scalar
 isnumber("1e1000") returns F (1e1000 is too large to be represented)
 isnumber("3.14",,paste(PI),"PI","?","T","3d10") returns
   vector(T,F,T,F,F,F,F)

See also topics 'macros', isarray(), ischar(), isdefined(), isfactor(),
isfunction(), isgraph(), islogic(), ismacro(), ismatrix(), isname(),
isnull(), isreal(), isscalar(), isstruc(), isvector(), nameof().


Gary Oehlert 2003-01-15