Skip to content

Reflection

Include: Use System\Reflection.pkg

Reflection inspects runtime value types, struct metadata, array metadata, stack arguments, and function return-call information.

Handles returned by StructTypeOf, ArrayTypeOf, and related APIs are metadata handles for the running program. Invalid handles, wrong value types, and out-of-range indexes raise a DataFlex error.

Value and call inspection

  • DfType identifies DataFlex runtime value types returned by Reflection APIs.
  • TypeOf returns the DfType constant for a value.
  • Get_Stack_Argument reads an argument from the current call stack frame.
  • TypeOfCallInfo reports the declared return value type requested by the caller.
  • StructTypeOfCallInfo returns struct metadata for a struct return call.
  • ArrayTypeOfCallInfo returns array metadata for an array return call.

Struct metadata

Array metadata