6.8.49 DMcob_SetValue

With this function you can change attributes of DM objects. For the permitted attributes of the respective object types, please refer to chapter “Attributes and Definitions”.

call "DMcob_SetValue" using
            DM-StdArgs
            DM-Value.

Parameters

-> DM-object of DM-Value

This parameter describes the object whose attributes you want to change. You have received this identifier as the return value from the DMcob_PathToID function.

-> DM-Attribute of DM-Value

This parameter describes the object attribute you want to change. All permitted attributes are defined in the IDMcobws.cob file.

-> DM-Index of DM-Value

This parameter is analyzed only in vector attributes of objects. It describes the index of the searched sub-object (e.g. text in listbox).

-> DM-Indexcount of DM-Value

This parameter indicates how many index values are to be noticed when calling the function:

  • 2-dimensional attributes -> value = 2 has to be set
  • 1-dimensional attributes -> value = 1 has to be set
  • non-indexed attributes -> value = 0 has to be set

-> DM-value-string-putlen of DM-Value

This parameter indicates how long the string to be set can be ( 0 = Dialog Manager has to search for the fill character).

-> DM-value-object of DM-Value
-> DM-value-boolean of DM-Value
-> DM-value-classid of DM-Value
-> DM-value-integer of DM-Value
-> DM-value-string of DM-Value

In one of these values you can pass the value the attribute has to have. You should take care to set the appropriate element in this structure and the correct data type. For the data type of each attribute, please refer to chapter “Attributes and Definitions”.

-> DM-Options of DM-StdArgs

This parameter controls whether the DM is to trigger rule processing after an attribute was set successfully.

  • DMF-Inhibit

    If no events are to be sent, this parameter has to be specified by DMF-Inhibit.

  • DMF-ShipEvent

    If there are events to be sent, it has to be specified by DMF-ShipEvent.

COBOL Interface for Micro Focus Visual COBOL

Instead of DM-value-string, it is also possible to use DM-value-string-u when working with Unicode texts (UTF-16).

DM-value-string-getlen and DM-value-string-putlen continue to indicate the number of characters and not the number of bytes.

Return Value

DM-status of DM-StdArgs

DM-error

The attribute could not be set.

DM-success

The attribute was set successfully.

Example

To change the title of a window named "TestWindow" the COBOL program is to look like this:

    move 0 to DM-indexcount.

    move AT-title to DM-Attribute.

    move DT-string to DM-Datatype.

    move DMF-Inhibit to DM-Options.

    Call "DMcob_SetValue" using DM-StdArgs DM-Value.