4.5 Inquiring and Changing Attributes
To set and inquire attributes in the Dialog Manager two different data structures are used. In the DM-Value structure exactly one value can be inquired or set. In the DM-ValueArray structure, however, up to 16 values can be inquired or set by one call. The DM-ValueIndex structure is used to pass an additional index value.
These structures are defined in IDMcobls.cob and IDMcobws.cob.
4.5.1 DM-Value
By means of this structure exactly one value can be set or inquired in the Dialog Manager. This structure has the following definition:
02 DM-Value. 03 DM-object pic 9(9) binary value 0. 03 DM-attribute pic 9(9) binary value 0. 03 DM-indexcount pic 9(4) binary value 0. 03 DM-index pic 9(4) binary value 0. 03 DM-second pic 9(4) binary value 0. 03 DM-datatype pic 9(4) binary value 0. 03 DM-long-first pic 9(9) binary value 0. 03 DM-long-second pic 9(9) binary value 0. 03 DM-value-object pic 9(9) binary value 0. 03 DM-value-boolean pic 9(4) binary value 0. 03 DM-value-cardinal pic 9(4) binary value 0. 03 DM-value-classid pic XX value "??". 03 filler pic XX value low-values. 03 DM-value-integer pic S9(9) binary value 0. 03 DM-value-index. 04 DM-value-long-first pic 9(9) binary value 0. 04 filler redefines DM-value-long-first. 05 filler pic XX. 05 DM-value-first pic 9(4) binary. 04 DM-value-long-second pic 9(9) binary value 0. 04 filler redefines DM-value-long-second. 05 filler pic XX. 05 DM-value-second pic 9(4) binary. 03 DM-value-attribute pic 9(9) binary value 0. 03 DM-value-method pic 9(9) binary value 0. 03 DM-value-pointer pic X(8) value low-values. 03 DM-value-string-putlen pic 9(4) binary value 0. 03 DM-value-string-getlen pic 9(4) binary value 0. 03 DM-value-string-size pic 9(4) binary value 80. 03 DM-value-string-S. 04 DM-value-string pic X(80) value low-values. 04 filler pic X(80) value low-values. 03 filler pic XX value low-values.
Definition in the COBOL Interface for Micro Focus Visual COBOL
02 DM-Value. 03 DM-object pic 9(9) binary value 0. 03 DM-attribute pic 9(9) binary value 0. 03 DM-indexcount pic 9(4) binary value 0. 03 DM-index pic 9(4) binary value 0. 03 DM-second pic 9(4) binary value 0. 03 DM-datatype pic 9(4) binary value 0. 03 DM-long-first pic 9(9) binary value 0. 03 DM-long-second pic 9(9) binary value 0. 03 DM-value-object pic 9(9) binary value 0. 03 DM-value-boolean pic 9(4) binary value 0. 03 DM-value-cardinal pic 9(4) binary value 0. 03 DM-value-classid pic XX value "??". 03 filler pic XX value low-values. 03 DM-value-integer pic S9(9) binary value 0. 03 DM-value-index. 04 DM-value-long-first pic 9(9) binary value 0. 04 filler redefines DM-value-long-first. 05 filler pic XX. 05 DM-value-first pic 9(4) binary. 04 DM-value-long-second pic 9(9) binary value 0. 04 filler redefines DM-value-long-second. 05 filler pic XX. 05 DM-value-second pic 9(4) binary. 03 DM-value-attribute pic 9(9) binary value 0. 03 DM-value-method pic 9(9) binary value 0. $IF P64 SET 03 DM-value-pointer pointer value null. $ELSE 03 DM-value-pointer pointer value null. 03 filler pic X(4) value low-values. $END 03 DM-value-string-putlen pic 9(4) binary value 0. 03 DM-value-string-getlen pic 9(4) binary value 0. 03 DM-value-string-size pic 9(4) binary value 80. 03 DM-value-string-S. 04 DM-value-string pic X(80) value low-values. 04 filler pic X(80) value low-values. 03 filler redefines DM-value-string-S. 04 DM-value-string-u pic N(80) national. 03 filler pic XX value low-values.
Description of the Structure Elements
This is the object whose attribute is to be changed or returned.
This is the attribute which is to be set or returned.
This is the number of indexes which should be used by Dialog Manager when accessing or setting an attribute.
This is the first index of the attribute which should be set or returned.
This number is only valid or used if the attribute is an indexed attribute or if DM-indexcount is set at a value greater than 0.
This is the second index of the attribute which should be set or returned. This number is only valid or used if DM-indexcount is set at a value greater than 1.
This element represents the first index. It is only used if DM-indexcount is greater than 1 and a function is called that processes the long index. These functions can be recognized by the name DMcob_L*
. This allows index values in the range from 0 to 65535 to be passed to the Dialog Manager.
This element represents the second index. It is only used if DM-indexcount is greater than 1 and a function is called that processes the long index. These functions can be recognized by the name DMcob_L*
.
This describes which part of the structure is filled and should be used to get the value.
This is used to set or get an integer attribute.
This is used to set or get an attribute which is a Dialog Manager object like color, font, or object.
This is used to set or get boolean attributes.
This is used to pass the enumeration and cardinal values.
This is used to get the class to which the object belongs.
DM-value-first, DM-value-second
These two elements are always used together. They pass an index value on to the DM and return respectively an index value from the DM to the COBOL function.
DM-value-long-first, DM-value-long-second
These two elements are always used together. They contain a long index value with the value range 0 … 65535 that is passed to the Dialog Manager or returned by the Dialog Manager to the COBOL function.
This element is allocated if the identifier of a user-defined attribute is to be queried.
This element is used for the handling of methods implemented in DM.
This element is used to pass collections (value references) and data of the data type DT-anyvalue.
It is only used by the COBOL Interface for Micro Focus Visual COBOL.
This can be set to show the Dialog Manager the end of a string if the string is to be terminated by a value which differs from the definitions. The number of characters is to be specified.
This contains the length of the returned string from the Dialog Manager. The number of characters is specified.
Internal field, not to be changed directly! The number of characters is specified.
This is used to set or get string attributes. These strings must not be longer than 80 characters.
In this element, strings can be passed as National Character (PIC N) when working with Unicode strings (UTF-16) (Micro Focus Visual COBOL only).
Note
Before IDM version A.06.01.d the structure DM-Value had this definition:
02 DM-Value. 03 DM-object pic 9(9) binary value 0. 03 DM-attribute pic 9(9) binary value 0. 03 DM-indexcount pic 9(4) binary value 0. 03 DM-index pic 9(4) binary value 0. 03 DM-second pic 9(4) binary value 0. 03 DM-datatype pic 9(4) binary value 0. 03 DM-long-first pic 9(9) binary value 0. 03 DM-long-second pic 9(9) binary value 0. 03 DM-value-object pic 9(9) binary value 0. 03 DM-value-boolean pic 9(4) binary value 0. 03 DM-value-cardinal pic 9(4) binary value 0. 03 DM-value-classid pic XX value "??". 03 filler pic XX value low-values. 03 DM-value-integer pic S9(9) binary value 0. 03 DM-value-first pic 9(4) binary value 0. 03 DM-value-second pic 9(4) binary value 0. 03 DM-value-attribute pic 9(9) binary value 0. 03 DM-value-method pic 9(9) binary value 0. 03 DM-value-string-putlen pic 9(4) binary value 0. 03 DM-value-string-getlen pic 9(4) binary value 0. 03 DM-value-string-size pic 9(4) binary value 80. 03 DM-value-string pic X(80) value low-values. 03 filler pic XX value low-values.
4.5.2 DM-ValueIndex
This structure allows for a full-fledged index argument. It is used by the DMcob_Value* functions of the COBOL Interface for Micro Focus Visual COBOL to process the collection data types. However, the structure is available for all supported COBOL variants and is not restricted to these application areas. It is identical to the DM-Value structure.
4.5.3 DM-ValueArray
For the call of some Dialog Manager functions an array of up to 16 structure elements is needed. To do so, the following structure is available:
02 DM-ValueArray. 03 DM-value-size pic 9(4) binary value 16. 03 DM-value-count pic 9(4) binary value 0. 03 DM-ValueRecord occurs 16 indexed by DM-valuecount. 04 DM-va-object pic 9(9) binary value 0. 04 DM-va-attribute pic 9(9) binary value 0. 04 DM-va-indexcount pic 9(4) binary value 0. 04 DM-va-index pic 9(4) binary value 0. 04 DM-va-second pic 9(4) binary value 0. 04 DM-va-datatype pic 9(4) binary value 0. 04 DM-va-long-first pic 9(9) binary value 0. 04 DM-va-long-second pic 9(9) binary value 0. 04 DM-va-value-object pic 9(9) binary value 0. 04 DM-va-value-boolean pic 9(4) binary value 0. 04 DM-va-value-cardinal pic 9(4) binary value 0. 04 DM-va-value-classid pic XX value "??". 04 filler pic XX value low-values. 04 DM-va-value-integer pic S9(9) binary value 0. 04 DM-va-value-index. 05 DM-va-value-long-first pic 9(9) binary value 0. 05 filler redefines DM-va-value-long-first. 06 filler pic XX. 06 DM-va-value-first pic 9(4) binary. 05 DM-va-value-long-second pic 9(9) binary value 0. 05 filler redefines DM-va-value-long-second. 06 filler pic XX. 06 DM-va-value-second pic 9(4) binary. 04 DM-va-value-attribute pic 9(9) binary value 0. 04 DM-va-value-method pic 9(9) binary value 0. 04 DM-va-value-pointer pic X(8) value low-values. 04 DM-va-value-string-putlen pic 9(4) binary value 0. 04 DM-va-value-string-getlen pic 9(4) binary value 0. 04 DM-va-value-string-size pic 9(4) binary value 80. 04 DM-va-value-string-S. 05 DM-va-value-string pic X(80) value low-values. 05 filler pic X(80) value low-values. 04 filler pic XX value low-values.
Definition in the COBOL Interface for Micro Focus Visual COBOL
02 DM-ValueArray. 03 DM-value-size pic 9(4) binary value 16. 03 DM-value-count pic 9(4) binary value 0. 03 DM-ValueRecord occurs 16 indexed by DM-valuecount. 04 DM-va-object pic 9(9) binary value 0. 04 DM-va-attribute pic 9(9) binary value 0. 04 DM-va-indexcount pic 9(4) binary value 0. 04 DM-va-index pic 9(4) binary value 0. 04 DM-va-second pic 9(4) binary value 0. 04 DM-va-datatype pic 9(4) binary value 0. 04 DM-va-long-first pic 9(9) binary value 0. 04 DM-va-long-second pic 9(9) binary value 0. 04 DM-va-value-object pic 9(9) binary value 0. 04 DM-va-value-boolean pic 9(4) binary value 0. 04 DM-va-value-cardinal pic 9(4) binary value 0. 04 DM-va-value-classid pic XX value "??". 04 filler pic XX value low-values. 04 DM-va-value-integer pic S9(9) binary value 0. 04 DM-va-value-index. 05 DM-va-value-long-first pic 9(9) binary value 0. 05 filler redefines DM-va-value-long-first. 06 filler pic XX. 06 DM-va-value-first pic 9(4) binary. 05 DM-va-value-long-second pic 9(9) binary value 0. 05 filler redefines DM-va-value-long-second. 06 filler pic XX. 06 DM-va-value-second pic 9(4) binary. 04 DM-va-value-attribute pic 9(9) binary value 0. 04 DM-va-value-method pic 9(9) binary value 0. $IF P64 SET 04 DM-va-value-pointer pointer value null. $ELSE 04 DM-va-value-pointer pointer value null. 04 filler pic X(4) value low-values. $END 04 DM-va-value-string-putlen pic 9(4) binary value 0. 04 DM-va-value-string-getlen pic 9(4) binary value 0. 04 DM-va-value-string-size pic 9(4) binary value 80. 04 DM-va-value-string-S. 05 DM-va-value-string pic X(80) value low-values. 05 filler pic X(80) value low-values. 04 filler redefines DM-va-value-string-S. 05 DM-va-value-string-u pic N(80) national. 04 filler pic XX value low-values.
Description of the Structure Elements
This is the total size of the array. It is set at 16 by the Dialog Manager as a standard. This value may be changed by the user to allow to set more then sixteen values by one function call.
This is the number of currently used values in the array. The value has to be set and has to be less than or equal to the DM-value-size.
This is the object whose attributes are to be changed or returned.
This is the attribute which should be set or returned.
This is the number of indexes which are to be used by accessing or setting the attribute.
This is the first index of the attribute which should be set or returned. This number is only valid if DM-va-indexcount is specified by a value greater than 0.
This is the second index of the attribute which should be set or returned. This number is only valid if DM-va-indexcount is specified by a value greater than 1.
This describes which part of the structure is filled and should be used to get the value.
This is used to set or get an integer attribute.
This is used to set or get an attribute which is a Dialog Manager object like color, font or object.
This is used to set or get boolean attributes.
This is used to pass the enumeration and cardinal values.
This is used to get the class to which the object belongs.
DM-va-value-first, DM-va-value-second
These two elements are always used together. They pass an index value on to the DM and return respectively an index value from the DM to the COBOL function.
DM-va-value-long-first, DM-va-value-long-second
These two elements are always used together. They contain a long index value with the value range 0 … 65535 that is passed to the Dialog Manager or returned by the Dialog Manager to the COBOL function.
This element is allocated if the identifier of a user-defined attribute is to be queried.
This element is used for the handling of methods implemented in DM.
This element is used to pass collections (value references) and data of the data type DT-anyvalue.
It is only used by the COBOL Interface for Micro Focus Visual COBOL.
This can be set to show the Dialog Manager the end of a string, if the string to be terminated differs from the definitions.
This contains the length of the returned string from the Dialog Manager.
Internal field, not to be changed directly!
This is used to set or get string attributes. These strings must not be longer than 80 characters.
In this element, strings can be passed as National Character (PIC N) when working with Unicode strings (UTF-16) (Micro Focus Visual COBOL only).
Note
Before IDM version A.06.01.d the structure DM-ValueArray had this definition:
02 DM-ValueArray. 03 DM-value-size pic 9(4) binary value 16. 03 DM-value-count pic 9(4) binary value 0. 03 DM-ValueRecord occurs 16 indexed by DM-valuecount. 04 DM-va-object pic 9(9) binary value 0. 04 DM-va-attribute pic 9(9) binary value 0. 04 DM-va-indextype pic 9(4) binary value 0. 04 DM-va-index pic 9(4) binary value 0. 04 DM-va-second pic 9(4) binary value 0. 04 DM-va-datatype pic 9(4) binary value 0. 04 DM-va-long-first pic 9(9) binary value 0. 04 DM-va-long-scrond pic 9(9) binary value 0. 04 DM-va-value-object pic 9(9) binary value 0. 04 DM-va-value-boolean pic 9(4) binary value 0. 04 DM-va-value-cardinal pic 9(4) binary value 0. 04 DM-va-value-classid pic XX value "??". 04 filler pic XX value low-values. 04 DM-va-value-integer pic S9(9) binary value 0. 04 DM-va-value-first pic 9(4) binary value 0. 04 DM-va-value-second pic 9(4) binary value 0. 04 DM-va-value-attribute pic 9(9) binary value 0. 04 DM-va-value-method pic 9(9) binary value 0. 04 DM-va-value-string-putlen pic 9(4) binary value 0. 04 DM-va-value-string-getlen pic 9(4) binary value 0. 04 DM-va-value-string-size pic 9(4) binary value 80. 04 DM-va-value-string pic X(80) value low-values. 04 filler pic XX value low-values.
4.5.4 Data Types in the Structures DM-Value and DM-ValueArray
If values are inquired from the DM with DM-Value or DM-ValueArray, the DM sets the structure element DM-datatype or DM-va-datatype according to the inquired attribute.
The following definitions are possible.
When setting attributes, there are several possible data types. Therefore, the element DM-datatype has to be set according to the used data type, so that the DM can read the value out of the corresponding element.
The possible values for DT-scope are:
1 |
|
2 |
|
3 |