UCM Unitec Home Page
      

Get UCM Version

 UciVersion(L)

Name   Environment   Synopsis   Description   Diagnostics   Notes   See also   Examples

Name

UciClientVersion, UciVersion

Environment

Unix, Win32 Cobol

Synopsis

COPY "UCI.CPY".

CALL "UciVersion" USING UCI-PAR
                                          UCI-RELEASE.

CALL "UciClientVersion" USING UCI-PAR
                                                   UCI-RELEASE.

Description

UciVersion retrieves the current version number of the UCM library used to link the program into the UCI-VERSION field of the UCI-RELEASE structure. The value contains the sum of the major release number multiplied by 100 and the minor release number, i.e. release 2.03 will be returned as 203.

UciClientVersion retrieves the current version number of the UCM Active-X control or the UciConnect library function used to establish the socket UCI-SOCKET in UCI-PAR with the caller. Starting with release 2.03 the client logic of UCM sends an internal version information message immediately after establishing a socket connection and before transmission of any application data. If this internal message is not received within UCI-TIMEOUT milliseconds or any application data is received without prior internal version information, a value of 0 (zero) will be returned in the UCI-VERSION field of the UCI-RELEASE structure, indicating an unknown version. It is usually safe to use a large value (e.g. 20'000) as UCI-TIMEOUT argument.

It is best to assume UCM 1.0 (formerly named UDM) if the UciClientVersion function returns zero in UCI-VERSION.

Both version functions may be used prior a call to UciInit.

UciClientVersion will fail and no version information will be returned if one or more of the following is true:

UE_CONNECT The socket identifier UCI-SOCKET has been removed, i.e. the connection has been terminated by the client (UCI-ERRNO 8).

Diagnostics

Upon successful completion UciVersion and UciClientVersion both return ZERO. Otherwise, the value of the  global ucmErrno is returned and the field UCI-ERRNO in the UCI-PAR structure is set to indicate the error. In most Cobol implementations the return code of C functions may be accessed through a predefined variable named RETURN-CODE.

Notes

The version functions have been introduced in release 2.03. The use of the UciClientVersion function with socket arguments created by older UCM clients will return a version value of zero, indicating an unknown version.

See also

UciConnect

Examples

 
COPY "UCI.CPY".

ACCEPT UCI-SOCKET FROM COMMAND-LINE.
CALL "UciClientVersion" USING UCI-PAR
                              UCI-RELEASE.
IF UCI-VERSION < 200
    PERFORM UDM-COMPATIBLE-COMM
ELSE
    PERFORM UCI-COMM.
...

 

Back to top