Menu

Variants

Will Pittenger

Variants in ASIL are based on unions. (See [Unions] if you need to read up on the syntax for unions.) Below is the declaration of the Variant type. Use it as you would any union.

union Variant.Types - Variant
  @

  public enum Types
    unknown = -1
    achar
    achar_null
    astring
    boolean
    boolean_null
    byte
    byte_null
    char
    char_null
    dbyte
    dbyte_null
    double
    double_null
    float
    float_null
    imaginary
    imaginary_null
    int
    int_null
    int16
    int16_null
    int32
    int32_null
    int64
    int64_null
    int8
    int8_null
    object
    obyte
    obyte_null
    qbyte
    qbyte_null
    string
    variant ' for a variant holding a variant
    word
    word_null

  struct = Types.achar
    public var achar m_achar

  struct = Types.achar_null
    public var ? achar m_achar_null

  struct = Types.astring
    public var astring m_astring

  struct = Types.boolean
    public var boolean m_boolean

  struct = Types.boolean_null
    public var ? boolean m_boolean_null

  struct = Types.byte
    public var byte m_byte

  struct = Types.byte_null
    public var ? byte m_byte_null

  struct = Types.char
    public var char m_char

  struct = Types.char_null
    public var ? char m_char_null

  struct = Types.dbyte
    public var dbyte m_dbyte

  struct = Types.dbyte_null
    public var ? dbyte m_dbyte_null

  struct = Types.double
    public var double m_double

  struct = Types.double_null
    public var ? double m_double_null

  struct = Types.float
    public var float m_float

  struct = Types.float_null
    public var ? float m_float_null

  struct = Types.imaginary
    public var imaginary m_imaginary

  struct = Types.imaginary_null
    public var ? imaginary m_imaginary_null

  struct = Types.int
    public var int m_int

  struct = Types.int_null
    public var ? int m_int_null

  struct = Types.int16
    public var int16 m_int16

  struct = Types.int16_null
    public var ? int16 m_int16_null

  struct = Types.int32
    public var int32 m_int32

  struct = Types.int32_null
    public var ? int32 m_int32_null

  struct = Types.int64
    public var int64 m_int64

  struct = Types.int64_null
    public var ? int64 m_int64_null

  struct = Types.int8
    public var int8 m_int8

  struct = Types.int8_null
    public var ? int8 m_int8_null

  struct = Types.object
    public Object m_object

  struct = Types.obyte
    public var obyte m_obyte

  struct = Types.obyte_null
    public var ? obtye m_obyte_null

  struct = Types.qbyte
    public var qbyte m_qbyte

  struct = Types.qbyte_null
    public var ? qbyte m_qbyte_null

  struct = Types.string
    public var String m_string

  struct = Types.variant
    public var Variant m_variant

  struct = Types.word
    public var word m_word

  struct = Types.word_null
    public var ? word m_word_null

  ~~

Related

Wiki: Home
Wiki: The basics (pun intended)
Wiki: Unions