6.8.64 DMcob_ValueInit

With this function a value can be converted into a local or global value reference managed by the IDM. This allows the further manipulation of the value by DMcob_Value* functions and its transfer as parameter or return value.

The value reference is initialized with the appropriate type. The collection data types DT-list, DT-vector, DT-hash, DT-matrix and DT-refvec are also permitted.

If the value reference is initialized as static or global via the DMF-StaticValueoption, access is also possible outside the function call. Value lists and strings are not released at the end of the function. The initialization of arguments as static or global managed value references is not allowed.

Collections are created without element values. All other value types are also initialized with a 0 value.

The function DMcob_ValueChange can be used to add or change values or part values respectively elements.

77 AnyValue pointer  value  null.
77 Type     pic 9(4) binary value 0.

call "DMcob_ValueInit" using
            DM-StdArgs
            AnyValue
            Type
            DM-Value.

Parameters

<-> DM-options of DM-StdArgs

Option

Meaning

0

The value reference will be initialized as a local value.

DMF-StaticValue

The value reference will be initialized as a global, static value.

<- AnyValue

Handle of the newly created Managed Value.

-> Type

This parameter specifies the requested initial type.

-> DM-indexcount of DM-Value

In this parameter the initial size of collections like list or matrix can be specified or the appropriate value type for vector values.

Return value

DM-status of DM-StdArgs

DM-error

The value reference could not be initialized.

DM-success

The function has been completed successfully so the value reference is initialized.

Availability

COBOL Interface for Micro Focus Visual COBOL only.

See also

Chapter “Using the anyvalue Data Type”