6.8.43 DMcob_PathToID

With this function, the external object name which you already know is transformed into an internal identifier. This internal identifier is not changed during program execution, so you do not have to inquire the ID of a frequently used object on every access.

01  DM-objectid  pic 9(4) binary value 0.
01  DM-rootid    pic 9(4) binary value 0.
01  DM-path      pic X(256).

call "DMcob_PathToID" using
            DM-StdArg
            DM-objectid
            DM-rootid
            DM-path.

Parameters

<- DM-objectid

0

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

!= 0

Identifier of the searched object.

With the thus received identifier you may now access the attributes of the identified object.

-> DM-rootid

This parameter controls from which object the Dialog Manager is to begin searching your desired object. You have the following options:

  • rootid = 0

    The Dialog Manager searches in the entire dialog definition for the specified object. This is the usual option. The identifiers of rules, functions, variables and resources can also be inquired this way.

  • rootid != 0

    The Dialog Manager is to search the desired object on the next subordinate hierarchy level from the specified object. This method is appropriate only if an object identifier occurs more than once in a dialog. Rules, functions, variables and resources cannot be inquired this way.

-> DM-path

This path describes the searched object. The path has to describe an object uniquely. If the object identifier exists only once in the dialog, giving the identifier is sufficient to get the desired reference. If the object identifier is not unique, the object has to be described with a path of object identifiers, separated by periods.

The path should be terminated with a low value or the separator character. Otherwise no more than 256 characters are read.

COBOL Interface for Micro Focus Visual COBOL

The parameter may also be passed as National Character (PIC N) when working with Unicode texts (UTF-16).

Return Value

DM-status

DM-error

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

DM-success

The identifier of the searched object is returned.

Note

The identifiers of all objects, resource variables, functions and rules can be inquired with this function!

Example

    Call "DMcob_PathToID" using DM-StdArgs DM-object
            DM-rootID By content "ObjectToAccess".