3.47 DM_ParsePath
With this function, the identifier of an object can be queried if more than one dialog is loaded and the searched object is not in the first loaded dialog.
DM_ID DML_default DM_EXPORT DM_ParsePath
(
DM_ID dialogid,
DM_ID rootid,
DM_String path,
DM_UInt idx,
DM_Options options
)
Parameters
-> DM_ID dialogid
This is the identifier of the dialog in which to search for the object.
-> DM_ID rootid
This parameter controls from which object the IDM starts the search for the object. There are the following options:
-
rootid = 0
The IDM searches for the specified object in the entire dialog definition.
This is the usual case. In this way the identifiers of rules, functions, variables and resources can be queried too.
-
rootid != 0
From the specified object, the IDM searches only on the next lower hierarchy level; lower hierarchy levels are not searched.
This procedure is only appropriate if an object name occurs more than once in a dialog.
-> DM_String path
This path defines the searched object. It must unambiguously describe an object.
If the object name exists only once within the dialog, then the indication of the name suffices to obtain the desired reference. If the object name is not unique, the object must be described by a point separated path of object names.
-> DM_UInt idx
This parameter specifies which occurrence of the object with the specified name shall be searched.
The counter starts at 0. To find the first occurrence of an object, enter 0 here.
-> DM_Options options
This parameter is currently not used.
Return Value
0 |
The searched object was not found or the name is not unique. That is, there are none or more objects with the given name. |
!= 0 |
Identifier of the searched object. |
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; /* Query an object in the dialog globally */ ID1 = DM_ParsePath(dialogID, 0, "FirstObject", 0, 0); /* Query using a path */ ID2 = DM_ParsePath(dialogID, 0, "FirstObject.Child1", 0, 0); }
See Also
Built-in function parsepath() in manual “Rule Language”