gmplCoclassStatement

CoClass Statement Summary

Coclass is a terminal or nonterminal declaration statement that occurs only in reference scripts. It declares a class that is actually the union of a group of classes.

The terminal form of the Coclass statement is used to deal with the forward reference problems in library declarations. It is often the case that a component in one class has the type of another type defining component that has not yet been defined. Rather than trying to sort the definitions into a "reference" order, gmBasic when it authors the declarations places a set of terminal Coclass statements in the front of the library declaration with only the Id attribute specified. The later Coclass statements with the same Id then specify the remaining attributes and substatements.

The attributes of the Coclass statement are as follows:

Attribute Description
Id This attribute is the identifier of the coclass. It must be unique with the scope of the library containing the coclass. The identifier is not case-sensitive. This attribute must be specified on all declarations, be they terminal or nonterminal.
Role This attribute contains an optional keyword describing the overall role of the coclass: Unknown, Property, Method, Define, Utility, Command, Constant, Function, Event, Control, Collection, Resource, Index, or Migclass. The default is None. Coclasses often have a Control role.
MigName This attribute supplies the name to be used for the coclass in the target translations.
MigStatus This attribute is a MigStatus attribute as discussed on the Declaration page. It contains generalized migration settings for the component
Creatable This is an On/Off flag attribute. The Off setting sets the Noncreatable status flag On. It means that the coclass objects cannot be created. When declaring objects of this coclass simply NULL them as opposed to using new to create an instance.
CastType This is an On/Off flag attribute. The Off setting sets the Casttype status flag On. This means that the coclass does not require type casts when setting its values.
AppObject This identifier attribute sets the AppObject status flag on and stores the identifier in the description table of the coclass. It means that the coclass has an application wide singleton object which requires that special AppObject code be authored for it.
MigComment This deprecated string attribute associates a comment with the coclass. This comment does not trigger the gmNI event handlers.
Static This is an On/Off flag attribute. The On setting sets the External status flag On. This means that the coclass is external to the library in the target implementation to which it was assigned in the source implementation. Therefore, when authoring the identifier of the coclass do not precede it with its source parent membership information.
MigPattern This string attribute associates a surface pattern string with code references to the coclass. See the Patterns page for details on the content of pattern strings. It is equivalent to the All pattern.
CshPattern This string attribute associates a surface pattern string with code references to the coclass. See the Patterns page for details on the content of pattern strings. It is equivalent to the Csh pattern.
VbnPattern This string attribute associates a surface pattern string with code references to the coclass. See the Patterns page for details on the content of pattern strings. It is equivalent to the Vbn pattern.

The declarations within the Coclass statement are as follows:

Substatement Description
Subclass Identifies a class that is a member of the coclass.

The script errors associated with the Coclass statement are as follows:

Error Description
1058 Coclass command missing required id attribute.
1059 Unable to store coclass vector: %1d
1060 The role keyword [%1d] is not recognized.
1061 Encountered following when expecting 'subclass': %1d


Subclass Coclass Subtatement Summary

Subclass is a terminal substatement of the Coclass statement. It identifies a class that is a member of the coclass.

The attributes of the Subclass substatement are as follows:

Attribute Description
Id This attribute is the identifier of a class within the same library that is a member of the coclass. Classes may be members of multiple coclasses.

The script errors associated with the Coclass statement are as follows:

Error Description
1062 Subclass command missing required id attribute.
1063 Unable to find subclass: %1d


Table of Contents