5.1.3 Structure Type Declaration

A class module declares a user defined type and its member methods, specifies the source language for each member and includes other classes used by this class.

  Variant Pointer


Variant pointers can reference one of several types or contain zero to indicate a null pointer. Note that variant pointers can not encode Parcel values other than zero. Data cannot be accessed directly through a variant pointer. To do this you must first assign the variant pointer to an invariant pointer. The current type of the variant pointer must match or zero will be assigned.

A variant pointer may be assigned to the address of an object or the address in an invariant pointer. The type of the variable or invariant pointer must be in the variant type list.


A variant pointer may also be assigned to the address in another variant pointer, but only if the type lists match and are declared in the same order.


There must be fewer types in the list of types than the smallest alignment of the types in the list. For example, if the smallest alignment is a Word (4 bytes) the list can contain either two or three types. Consequently variants cannot reference byte or parcel aligned objects.


The current type contained in a variant pointer can be determined using the Parcel function. It will returns the position of the type corresponding to the current setting or zero if the variant pointer is set to zero.


Virtual Generic Class

Enumerated Type Declaration