Synopsis

(macro) PDX_MSGT mda_GetField(MDA_PTR db_ptr, void *type, void *field, void *result)

Purpose

Obtain the value of a scalar entity field.

Description

The value of the structure member field in db_ptr is copied to result. This provides a quick method for an application to obtain the value of a scalar field (or a single element from an array field). The type argument defines the entity type of db_ptr and will always be a T_ structure. The field argument is the member field with in the T_ structure.

Given a DDF entry of:

.nf .RS 3 entity 1:0 POINT { int color; double origin[3]; } .RE .fi

The following calls can be made using mda_GetField:

.nf .RS 3 int cnum; double x_loc;

mda_GetField (db_ptr, T_POINT, color, &cnum); mda_GetField (db_ptr, T_POINT, origin[0], &x_loc); .RE .fi

Input

db_ptr

Database pointer to be dereferenced

type

The T_ type of the entity or void

field

Name of the member field within type which is to be copied

Output

result

Contents of field within the entity

Return

MDA error code