| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 12)

Attribute Contents

Attributes can contain values, such as integers, floats, symbols, text strings, truth-values, sequences, and structures. For information on the values that attributes can contain, see Values and Types.

Attributes can also contain instances of user-defined classes of objects, or instances of variable and parameter classes. An object contained in an attribute of another object is called a subobject. For information on accessing the attributes of objects contained in an attribute, see Displaying the Subtable for an Attribute that Contains an Object.

Some attributes contain the text of a text-based item, such as a rule or procedure. These are called text attributes. You work with the text attribute of an item just as you would work with other named attributes.

Other item attributes contain actions, statements, or G2 expressions, such as the Action attribute of an action button, the text attributes of rules and procedures, and the Item-configuration attribute of items. These are called compiled attributes. Items that have compiled attributes might have dependencies upon other items that affect their compilation status, as described in Using Compilation Configurations.

Distinguishing System- and User-Defined Attributes

An item's attributes are either system-defined or user-defined. The G2 system-defined classes define system-defined attributes for items. You cannot change the definitions of any system-defined attributes.

When you create user-defined classes, you can also declare user-defined attributes for those classes. Chapter 14, Definitions describes how to create user-defined classes and user-defined attributes.

You can refer to most system-defined attributes of items. Some system-defined attributes, such as Notes, are text-readable only. You can refer to the text of such attributes, but not to their values directly. Accessing system-defined attributes is described in Chapter 12, Attribute Access Facility.

To access programmatically the value of a text-readable only system-defined attribute:

For example, the next figure shows an action button. Pressing this action button displays the text of its own Notes attribute in a message that G2 posts to the Message Board workspace:


After you create a user-defined class with user-defined attributes, you can interactively edit any user-defined attribute in each instance of that class. Your KB can also conclude the value of any user-defined attribute.

To suppress interactive editing of editable attributes:

Declaring configurations is the subject of Chapter 7, Configurations.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 12)

Copyright © 1997 Gensym Corporation, Inc.