reflect.Type.getFieldCount

Returns the number of fields of record type.

Syntax

getFieldCount()
  RETURNS INTEGER

Usage

The getFieldCount() method returns the number of members of the record type represented by this reflect.Type object.

The reflect.Type object used to call this method must have been created with a RECORD variable, or is a reflect.Type object returned from a method like reflect.Value.getType() or getElementType(), and references a record structure.

Example

IMPORT reflect
MAIN
    DEFINE rec RECORD
                   pkey INTEGER,
                   name VARCHAR(30)
               END RECORD
    DEFINE typ reflect.Type
    LET typ = reflect.Type.typeOf( rec )
    DISPLAY "field count  = ", typ.getFieldCount()
END MAIN
Shows:
field count  =           2