| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (17 out of 22)

Miscellaneous Parameters

The Miscellaneous Parameters system table lets you control certain aspects of the KB.

Defining Whether to Repeat the Random Function

The Repeat-random-function-on-reset? attribute defines whether G2 shuffles the function upon a KB reset. If the attribute is set to yes, G2 does nothing and the random function returns the same sequence of random numbers after each reset, if it has the same argument.

If this attribute is set to no, G2 seeds the random function so that it returns a different sequence of random numbers after each reset.

Specifying the Workspace Margin

The Initial-margin-for-workspaces attribute specifies how close you can place icons at the edge of a workspace. The margin must be a non-negative integer value, measured in workspace units. The smaller the integer, the closer to the edge of the workspace you can place an icon.

Starting a KB Automatically After KB Load

The Start-kb-after-load? attribute determines whether G2 starts the KB whenever it is loaded. G2 automatically starts the KB if this attribute is set to yes and displays an operator logbook message indicating that the KB has been started because of the system table setting.

The Load KB option never start afterwards overrides the Start-kb-after-load? setting. For more information on this option and others, see Selecting Options When Loading a KB File.

Determining the KB Run State

The g2-run-state attribute determines the current run state of the KB. It has a symbol value which can be reset, running, or paused.

KB developers can query the value of this attribute to determine the current run state of the KB, for example:

Changing the Backward Compatibility

The Backward-compatibility-features attribute lets you revert certain changes made in G2 since previous versions.

Currently, the two changes that you can revert by completing this attribute are:


Tip: By default, loading a KB created by an earlier version of G2 changes the value of this attribute to include both of these options.

Ignoring Duplicate List Element Error

The Ignore-duplicate-list-element-error value causes G2 to disregard a change made to the insert action. The change to the action causes G2 to signal an error any time an attempt is made to insert duplicate elements into a list that disallows them.

List items can allow or disallow duplicate elements. In previous G2 releases, attempting to insert a duplicate element into list items that disallowed them caused G2 to signal an error unless the insert action specified an element location of either:

Attempting to insert duplicate elements into a list that disallows them now causes G2 to signal an error consistently. This change of behavior can affect existing KBs.

Entering the value ignore duplicate list element error essentially reverses the change to the insert action for list elements to its previous behavior. Use this value if your KB relies on the previous behavior.

Returning Additional Connection Vertices

In previous G2 versions, the g2-get-connection-vertices system procedure returned the exact number of vertices of which a connection consisted. The purpose of this system procedure is to populate a list with the connection vertices of an existing connection, and then to use that list with the create connection action. The create action, however, does not require or expect the exact number of vertices. Instead, it requires only a minimum number of vertices. To recreate a connection, the create connection action determines the last one or two vertices from the position of the object to which a connection is being joined.

The g2-get-connection-vertices system procedure currently returns the minimum number of vertices that the create connection action requires. However, existing KBs may rely on the previous behavior or having the system procedure return the exact number of vertices. Specifying the value:

in the Backwards-compatibility-features attribute causes the system procedure to behave as it did in previous releases.

For more information about... See...
Inserting elements into lists
Inserting Into Lists With Duplicate Elements
Creating connections using the g2-get-connection-vertices system procedure
Recreating an Existing Connection Programmatically
The g2-get-connection-vertices system procedure
G2 System Procedures Reference Manual

Class-Specific Attributes of Miscellaneous Parameters

The class-specific attributes of the Miscellaneous Parameters system table are:

Attribute Description
Repeat-random-function-on-reset?
Controls whether the random function is scrambled when G2 is reset.
Allowable values:
{yes | no}
Default value:
no


Initial-margin-for-workspaces
Controls the size of the margin for workspaces.
Allowable values:
integer
Default value:
30


Start-kb-after-load?
Controls whether G2 is started immediately after loading a KB. If this attribute is set to yes, G2 is started after loading the KB.
Allowable values:
{yes | no}
Default value:
no


G2-run-state
Determines the run state of the current KB.
Allowable values:
{reset | running | paused}
Default value:
reset


Backward-compatibility-features
Lets you disregard certain changes made in recent G2 releases.
Allowable values:
{none | ignore duplicate list element error |
extra vertices in g2-get-connection-vertices}

Default value:
none

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (17 out of 22)

Copyright © 1997 Gensym Corporation, Inc.