Attribute descriptions present the internal data structure and type of each accessible attribute in a system-defined class. You need to know this information before accessing and manipulating system-defined attributes.
In the class dictionary, all attribute names and their subattributes appear in bold type. Each attribute description includes this information:
You can also obtain the descriptions programmatically from G2, using the system procedure
g2-get-attribute-descriptions-of-class. Differences Between the Value and Text of an Attribute
The G2 Class Reference Manual describes whether an item attribute is:
text-readable
value-readable
text-writable
value-writable
the text of expressions, but you cannot change the attribute, either through a change the text of statement or a conclude that the x of y expression. This is the way you can refer to or change system-defined attributes:
| If an attribute is: | You can: |
|---|---|
text-readable
|
Refer to it as:
|
value-readable
|
Refer to it as:
|
text-writable
|
Change its value using:
|
value-writable
|
Change its value using:
|
Viewing an Attribute Value or Text
When attributes are both text- and value-readable, you can view them both as a text and as a value. Class-specific-attributes attribute of a class definition, which is text- and value-readable and text- and value-writable. If you create a class definition called test-class, which defines two class-specific attributes as follows:
attr-1 is an integer, initially is 1; attr-2 is a text, initially is "two"
the class-specific-attributes of test-class
sequence
(structure
(attribute-name: the symbol attr-1,
attribute-type-specification: the symbol integer,
attribute-initial-value: 1,
attribute-initial-type: the symbol number),
structure
(attribute-name: the symbol attr-2,
attribute-type-specification: the symbol text,
attribute-initial-value: "two",
attribute-initial-type: the symbol text)
the text of the class-specific-attributes of test-class
attr1 is an integer, initially is 1; attr2 is a text, initially is @"two@"
Name-box.
| Attribute | Text-readable | Value-readable | Text-writable | Value-writable |
|---|---|---|---|---|
Format-of-image
|
![]() |
|
|
|
Item-status
|
|
![]() |
|
|
Notes
|
![]() |
![]() |
|
|
Authors
|
![]() |
|
![]() |
|
Change-log
|
![]() |
|
![]() |
|
KB developers can determine the status of each attribute's text-readable, text-writable, value-readable, and value-writable access by referring to the G2 Class Reference Manual, or by testing for these attributes programmatically as described next.
Example of Obtaining an Attribute Description
You can use the g2-get-attribute-descriptions-of-class system procedure to return the attribute description of one or more attributes programmatically. You can then test any aspect of the attribute to determine its functionality.
![]() |
When called with the arguments to get information about two attributes of a
G2-WINDOW object:
start get-attribute-information
(the symbol g2-window, sequence (the symbol item-configuration,
the symbol g2-user-mode) )
Item-configuration and G2-user-mode attributes of a window object, the procedure determines that the first attribute is value-writable, but that the second attribute is not. The next figure shows these results:
![]() |
Thus, you must use
change the text of statements to change the G2-user-mode attribute of the current window programmatically. Hidden Attributes
Some system-defined attributes are not visible in an item's attribute table, but are accessible programmatically, such as:
name-box
attribute-displays
item-x-position
item-y-position
Evaluation Attributes
The evaluation-attributes hidden attribute contains two characteristics of G2 items and how they participate in KB processing. Only one evaluation attribute is actively used.
Composite Attributes
Some attributes are composed of more than one subattribute, which you can refer to individually. The Notes attribute is an example of a composite attribute. These are the subattributes of Notes:
To reference both of its subattribute values requires two expressions:
the item-status of x
the item-notes of x
item-status returns the standard OK, INCOMPLETE, or BAD status, and item-notes returns a sequence of text values with actual notes.