reflect.Type.getFieldType
Returns the type of a member of a record type.
Syntax
getFieldType(
index INTEGER )
RETURNS reflect.Type
- index is the ordinal position of the field in the
RECORD
structure.
Usage
The getFieldType()
method returns a reflect.Type
object at the
given index, for 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 "type = ", typ.getFieldType(1).toString()
END MAIN
Shows:
type = INTEGER