Cicode Programming Reference > Cicode Function Categories > Format Functions Introduction > FmtFieldHnd

FmtFieldHnd

Gets the handle of a field in a format template. You can then use the field handle in the FmtGetFieldHnd() and FmtSetFieldHnd() functions. By using a handle, you only need to resolve the field name once and then call other functions as required (resulting in improved performance.)

Syntax

FmtFieldHnd(hFmt, Name)

hFmt:

The format template handle, returned from the FmtOpen() function. The handle identifies the table where all data on the associated format template is stored.

Name:

The field name.

Return Value

The handle of the format template field, or -1 if the field cannot be found.

Related Functions

FmtGetFieldHnd, FmtSetFieldHnd

Example

!Resolve names at startup.
hName=FmtFieldHnd(hFmt,"Name");
hDesc=FmtFieldHnd(hFmt,"Desc");
!Set field data.
FmtSetFieldHnd(hFmt,hName,"CV101");

See Also

Format Functions