CMPVER


9.1E

 

The CMPVER compiler directive reports the compiler version value that is created for a specified string. The directive uses the following formats:

 

 

CMPVER({verid}

 

Where:

verid

Required. A special formatted string that identifies the compiler version used to calculate the version value.

Flags Affected: NONE

Note the following:

  1. The S$CMPVER$ compiler directive is a special compiler directive that represents the current compiler version that is being used when a program is compiled.

  2. The CMPVER compiler directive requires an input string that is processed to give the expected EQU value that gives the expected numeric value for any compiler version.

  3. Since the S$CMPVER$ and CMPVER directive values are represented as equated values, any given value cannot be larger than 0xFFFF.

  4. The S$CMPVER$ and CMPVER compiler directives are calculated by the compiler as follows:

  5.  

    Compiler Version: 'MNP'

    Where:

    M
    Major version number. This character must be a valid hexadecimal digit. ( 0 to F ).
    N
    Minor version number. This character must be a valid hexadecimal digit. ( 0 to F ).
    P
    Patch release identifier. This character must be a character specified as ( 0 to 9 ) or ( A to Z ). The value of the 'P' character in this case is transformed into a Base 36 value. (i.e., Value is 0 to 35 decimal ).

     

    Using the 'MNP' format, the compiler version is calculated by the following expression:

     

    VERVALUE = ( ( ( ( M * 16 ) + N ) * 256 ) + P )

     

    CMPVER(91) --> VERVALUE = 0x9100

    CMPVER(91E) --> VERVALUE = 0x910E

    CMPVER(91F) --> VERVALUE = 0x910F

    CMPVER(91G) --> VERVALUE = 0x9110

    CMPVER(91Z) --> VERVALUE = 0x9123

Examples:

 

eVER91E

EQU

CMPVER(91E)

eVER91Z

EQU

CMPVER(91Z)

VER91E

INTEGER

2,eVER91E

VER91Z

INTEGER

2,eVER91Z

.

 

 

 

%IF

S$CMPVER$ >= CMPVER(91E)

 

DISPLAY

"DO NEW CODE!"

 

%ELSE

 

 

DISPLAY

"DO OLD CODE!"

 

%ENDIF

 

 

 

See Also: Compiler Directives

 



PL/B Language Reference CLASSMODULE CONST