reflect.Type.getKind

Returns the kind of a type.

Syntax

getKind()
  RETURNS STRING
  1. Possible returned values: PRIMITIVE, RECORD, ARRAY, DICTIONARY, FUNCTION, INTERFACE.

Usage

The getKind() method returns the kind of this reflect.Type object.

The kind can be:
Tip:

Based on the kind of the reflect.Type object, use the methods corresponding to that kind: getElementType() for "ARRAY" or "DICTIONARY", getMethod() for "INTERFACE", etc.

Example

IMPORT reflect
MAIN
    DEFINE arr DYNAMIC ARRAY OF STRING
    DEFINE dic DICTIONARY OF STRING
    DEFINE rec RECORD pkey INT END RECORD
    DEFINE dtm DATETIME YEAR TO FRACTION(5)
    DISPLAY "arr kind = ", reflect.Type.typeOf(arr).getKind()
    DISPLAY "dic kind = ", reflect.Type.typeOf(dic).getKind()
    DISPLAY "rec kind = ", reflect.Type.typeOf(rec).getKind()
    DISPLAY "dtm kind = ", reflect.Type.typeOf(dtm).getKind()
END MAIN
Shows:
arr kind = ARRAY
dic kind = DICTIONARY
rec kind = RECORD
dtm kind = PRIMITIVE