3.15 DM_DialogPathToID

Attention

The function DM_DialogPathToID is deprecated and is only supported for compatibility reasons. Please use DM_ParsePath instead.

By using this function you can query the identifier of an object if you have loaded more than one dialog and the desired object is not contained in the dialog loaded first.

DM_ID DML_default DM_EXPORT DM_DialogPathToID
(
  DM_ID dialogid,
  DM_ID rootid,
  DM_String path
)

Parameters

-> DM_ID dialogid

This is the identifier of the dialog in which the object is to be searched.

-> DM_ID rootid

By using this parameter you can control from which Dialog Manager object on the search for the desired object begins. There are the following possibilities:

  • rootid = 0

    The Dialog Manager searches for the specified object in the entire dialog definition.

    This is the usual case. You can also query the identifiers of rules, functions, variables and resources.

  • rootid != 0

    The Dialog Manager will search only on the next lower hierarchy level from the specified object on; the DM will not search on lower hierarchy levels.

    This procedure is suitable only if an object name appears more than once in a dialog.

-> DM_String path

This path describes the object being searched. The path has to describe an object unambiguously. If the object identifier exists only once in the dialog, it is enough if you specify the name to get the desired reference. If the object identifier is not unambiguous, the object has to be described by a path of object identifiers, separated by a dot.

Return Value

0

The object was not found or its identifier is not unique.

!= 0

Identifier of the searched object.

Annotation

If "setup" is specified as path and both dialogid and rootid are 0, then the setup object is returned.

Example

void DML_default DM_ENTRY OkButtonCallback __1((DM_ID, dialogID))

{

  DM_ID ID1;

  DM_ID ID2;

 

  /* Querying an object in the dialog globally */

  ID1 = DM_DialogPathToID(dialogID, 0, "FirstObject");

 

  /* Querying via a path */

  ID2 = DM_DialogPathToID(dialogID, 0, "FirstObject.Child1");

}

See Also

Function DM_ParsePath

Built-in function parsepath() in manual “Rule Language”