ContentsIndexPreviousNext

C$SETVARIANT Routine

This routine sets data items referenced by Variant handles.

C$SETVARIANT converts COBOL type data to Variant type data. Programs that call ACUCOBOL-GT using the ACUCOBOL-GT Automation Server or runtime DLL pass their parameters (by reference) as Variant types. The COBOL program receives handles to the Variant data. C$SETVARIANT sets the data associated with a particular handle to the value of a COBOL data item. The data is automatically converted to the proper Variant format.

Usage

CALL "C$SETVARIANT"
     USING SRC-ITEM, H-VARIANT
     GIVING RESULT-CODE

Parameters

SRC-ITEM Any COBOL data type

The source data item.

H-VARIANT USAGE HANDLE

Handle to Variant type data. Data passed in from a program calling ACUCOBOL-GT using the ACUCOBOL-GT Automation Server or runtime DLL is in the form of handles to Variant type data.

RESULT-CODE Signed numeric value

Receives the result code for the operation. This will be 0 or a positive value to indicate success or a negative value to indicate failure.

Under Microsoft Windows this is a code of type HRESULT that can be looked up in Microsoft documentation to determine the reason for the failure or additional information about the success.

Comments

The COBOL data item SRC-ITEM is converted to Variant type data, and is stored in the Variant item associated with H-VARIANT.