CDO$HELP.HLB  —  CDO Commands, DEFINE  RECORD Variants, Description
    The Variants Clause syntax identifies a set of overlays that can
    be used by a COBOL REDEFINES statement or by other languages.
    Each variants definition can contain two or more fields, records,
    structures, variants, or any combination of these definitions.

    Be sure that the variants definitions you define conform to the
    requirements of the language or language processor that accesses
    the record element. For example, you must include a structure
    definition for each variants clause contained in a CDO record if
    you are developing a new application that will use a 3GL language
    and DIGITAL DATATRIEVE.

    You can specify a different data type for each definition in a
    variants definition.

    You can create any number of variants definitions within a record
    element.

    You can create any number of definitions within a variants
    definition.

    If you use an expression with one variant, you must use an
    expression with every other variant in the variants definition.

    In variant expressions, you can refer to a tag variable (field
    definition) whose runtime value determines which variant in a
    variants definition maps to the record element. The tag variable
    cannot be part of an array.

    At runtime, the product using CDO tests the value of each
    Boolean expression in the variants definition to determine which
    definition is the current variants definition. The variants with
    a Boolean expression that evaluates to true is chosen.

    The values that you test for in the expressions of a variants
    definition must conform to the following rules:

    o  The values being tested must be valid values for the data type
       of the tag variable. For example, if the data type for the tag
       variable is text, the value you test for must be a string.

    o  The range of values being tested in one expression must not
       overlap the range of values in any other expression.

    Each variants definition begins on the same byte in the record,
    subject to individual alignment options. The length of the
    longest definition in a variants definition determines the
    overall length of the variants definition.
Close Help