C$GETVARIANT

This routine retrieves data referenced by a Variant handle. Typically, this is data passed to an ACUCOBOL-GT program from another language such as Visual Basic. Note that there is also a C$SETVARIANT routine that sets data items referenced by Variant handles

C$GETVARIANT converts Variant type data to COBOL 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$GETVARIANT gets the data associated with a particular handle and moves it to a COBOL data item. The data is automatically converted to the proper COBOL format.

Usage

CALL "C$GETVARIANT" 
    USING H-VARIANT, DEST-ITEM
    GIVING RESULT-CODE

Parameters

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.
DEST-ITEM Any COBOL data type The destination data item.
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 Variant data associated with H-VARIANT is moved to DEST-ITEM using standard MOVE rules. Data items must be defined in the LINKAGE section.

C$GETVARIANT is not supported by the ACUCOBOL-GT Thin Client technology, and will only run with a standalone Windows runtime.