# Synopsis

PDX_MSGT ddf_GetUnionTypeByType(const DDF_FLD *fld, int type, int *union_type)

# Purpose

Get the union type by field type.

# Description

The union type (for use with mda_Set/GetUnionType) will be returned for the first member of fld with the field type specified by type. The fld argument must be of type DDF_UNION (i.e. DDF_STRUCT with the DDF_UNION_FLG flag set). The type argument specifies the type to be located (e.g. DDF_INT would return the first int member in the union). Note that it is only possible to locate primitive types with this function. Specifying a type of DDF_STRUCT will return the union type for the first struct in the union. A type of DDF_UNION will return the union type for the first union in the union. Only the first member of the given type can be returned.

# Input

## fld

The union field to search for type in

## type

The type of field within fld to be located

# Output

## union_type

The union type of the first member with field type type.

# Return

DDF error code