Next: isreal()
Up: MacAnova Help File
Previous: isnull()
Contents
Usage:
isnumber(arg1 [, arg2, ... ]), arg1, ... CHARACTER scalars
|
Keywords:
macros, general, variables
Usage
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
Examples:
Cmd> isnumber("3.14")
(1) T
Cmd> isnumber(3.14) # not quoted
ERROR: argument 1 to isnumber() is not CHARACTER scalar
Cmd> isnumber("1e1000") # too large to be represented
(1) F
Cmd> isnumber("3.14",,paste(PI),"PI","?","T","3d10")
(1) T F T F F F T
Cross references
See also topics 'macros', isarray(), ischar(), isdefined(), isfactor(),
isfunction(), isgraph(), islogic(), ismacro(), ismatrix(), isname(),
isnull(), isreal(), isscalar(), isstruc(), isvector(), nameof().
Gary Oehlert
2005-08-12