Index

C/C++ Functions

pdNameGet

DT_SLONG pdNameGet(DT_PDDOC power_doc, DT_ID_SLONG obj, DT_SLONG idx, DT_UBYTE* type)

Short Description: Get property or link

The pdNameGet function retrieves the type and numeric value (i.e. field name) of the field located at position idx in the PowerDoc object obj.

Parameters

ParameterDescription

power_doc

Handle of the associated Power Engine document.

obj

Object's index in the Power Engine document.

idx

The index of the field in the object.

type

A pointer to a variable that will hold the field's type. Depending on the field, this will be one of the following:

  • 1 (PD_FT_PROPERTY) if the field at position idx is a PowerDoc property;
  • 2 (PD_FT_LINK) if the field at position idx is a PowerDoc link;
  • 3 (PD_FT_PROPERTYREFERENCE) if the field at position idx is a PowerDoc property reference;
  • 0 (PD_FT_UNKNOWN) if an error occurs.

Return Value

The return value is the numeric value (field name) of the field located at position idx.

If the field at position idx is a PowerDoc link, the return value will be one of the values used to identify links. See the pdLinkAdd function for a list of numerical values that identify PowerDoc links.

If the field at position idx is a PowerDoc property or property reference, the return value will be one of the values used to identify properties. See the pdPropAdd function for a list of numerical values that identify PowerDoc properties.

If idx is larger than the index of the last field in the object, the return value will be 0 (pdNul). Therefore, it is possible to use the idx variable as a loop counter to iterate through all the fields in the objects. The return value 0 (pdNul) will indicate that idx has reached the last field in the object obj.

Related Functions

pdPropAdd, pdLinkAdd

 

Index