type/attributed
check if an expression has attributes
Calling Sequence
Parameters
Description
Examples
type(expr, 'attributed')
type(expr, 'attributed(attr1, attr2, ... )')
expr
-
any expression
attr1, attr2, ...
(optional) expressions representing attributes
An expression is of type attributed if it has attributes; that is, if the expression sequence of its attributes is not NULL.
The command type(expr, 'attributed') returns true if expression expr is of type attributed. Otherwise, false is returned.
By using the second form of the calling sequence, you can check for one or more specific attributes. In this case, the test returns true if the expression expr has all of the specified attributes attr1, attr2, .... Otherwise, false is returned.
typesin,attributed
true
typesin,attributedblue
false
typesin,attributedprotected
attributessin
protected,_syslib
setattributefoo,red,blue
foo
typefoo,attributed
typefoo,attributedred
typefoo,attributedblue
typefoo,attributedred,blue
typefoo,attributedred,blue,green
See Also
attributes
setattribute
type
Download Help Document