typeCheck()

Synopsis

Determines if Value is acceptable for the type indicated by typeName. The typeName() function is a complementary function that returns the type of a value.

Syntax

typeCheck ( value As Any, _
            TypeName As Name ) As Boolean 
Argument Type Description
value Any Input value to test; this argument is permitted to be NoValue .
TypeName Name Data type name, such as Number , String , Part , etc.

Example 1

Integers are Numbers
Intent >typeCheck(1, :number) 
--> True 

Example 2

Names are not Strings
Intent >typeCheck(:NNNN, :string) 
--> False

Example 3

Root is a Part
Intent >typeCheck(Root, :part) 
--> True