CDDLHELP.HLB  —  VARIANTS OF field, Syntax Rules
   o  The VARIANT field description block can be repeated.

   o  The tag variable must be an elementary field fixed in the  record
      and  not part of an array, and it must precede the VARIANTS field
      description statement.  It cannot be an unnamed field.

   o  You must fully qualify the tag variable's field name if it is not
      unique  within the record.  A fully qualified field name consists
      of an elementary field name preceded by the  field  names  of  as
      many  of  its  direct  ancestors  as  you  need  to  specify  the
      elementary field uniquely.  You must separate each element  of  a
      fully qualified field name from the next with a period.

      Once the elementary field name is identified  uniquely,  you  can
      omit  any  remaining ancestors' field names.  Furthermore, if the
      tag variable's name is not unique within the record, none of  the
      ancestors in its fully qualified name can be unnamed fields.

   o  You must include a tag value clause for VARIANT.

   o  At run time, the values (low_value and high_value...) you specify
      are  compared  to  the value of the tag variable to determine the
      current VARIANT.

   o  Tag  value  specifications  must   conform   to   the   following
      conditions:

       -  The tag values low_value, high_value...  must be legal values
          as  defined by the tag variable's data type.  For example, if
          the tag variable is a TEXT field,  the  tag  values  must  be
          quoted literals.

       -  The values of high_value must be greater than or equal to the
          values  of  low_value  in  the collating sequence of the data
          type.

       -  The range of values in one VARIANT must not overlap the range
          of values in any other VARIANT.

   o  The compiler ignores commas, but you can use  them  to  make  tag
      value specifications easier to read.

   o  The CDDL compiler does not check that the tag values you  specify
      are legal.  If you specify invalid values, you will receive error
      messages when you refer to the VARIANT field in an application.
Close Help