Accessing a Database, V+ Variable, or $ai.ctl[ ] String Value

A string menu item allows displaying or updating of a database field value, V+ string variable, or an $ai.ctl[ ] value.

To create a new string menu item, display the menu page you want to create a menu item for and select:

Utilities -> Edit Menu -> New -> String

To edit an existing menu item, display the menu page the string menu item is on and select:

Utilities -> Edit Menu -> double-click on item to be edited

Figure 8-5. String Menu Item

String Value Options

1-8

These fields behave in the same way as the fields for numeric values (for details, see Accessing a Database, AIM Variable, V+ Variable, or ai.ctl[ ] Numeric Value) with the following exceptions:

When accessing a database, the field you access must be a string field. You must provide the database number, the field number, and the index number.

When accessing a V+ variable, you will be accessing a string variable. You must provide the variable name.

When accessing an AIM variable, you will be accessing a string variable. You must provide the variable name.

When accessing an ai.ctl[ ] value, you will be accessing the string array $ai.ctl[ ] instead of the numeric array
 ai.ctl[ ]. You must provide the $ai.ctl index number.

9

 This section gives you the additional option of displaying a sequence name or a V+ program name.

If Standard is selected, the string value is simply displayed.

If V+ Program is selected, the string is interpreted as a V+ program name. If a user double-clicks on the string field, the V+ developer utility will be invoked to edit that program.

If AIM Sequence is selected, the string is interpreted as an AIM sequence name within the current module. If a user double-clicks on the string field when it is empty (or if the Display function key is pressed), a pick list of sequences in the current module is displayed. If a user double-clicks on the string field when it is not empty (or if the Goto function key is pressed), the AIM sequence editor is invoked to edit the program.

If Single keyword is selected, the string value entered must match one of the keywords in a keyword list.

If Keyword list is selected, a scrolling window of possible keyword strings from a keyword list is displayed.

For keywords, the actual value of the selected keyword is used, not the index of the keyword.

10

Specify the justification of the displayed string. If Opaque background is selected, the background for the menu item will be gray. If Box value is selected, a black rectangle will be drawn around the item.

Control Values (ai.ctl[ ] Arrays)

AIM provides two arrays that can be used to store global values, or as temporary storage during AIM execution. The array for numeric values is ai.ctl[ ]. The array for string values is $ai.ctl[ ]. The following control values are reserved and should not be changed by system customizers:

Table 8-1. ai.ctl[ ] Reserved Ranges
Array Elements
Dedicated Use
ai.ctl[0] - ai.ctl[3]
reserved for the menu driver
ai.ctl[4] - ai.ctl[31]
reserved for system state variables
ai.ctl[32] - ai.ctl[40]
reserved for vision
ai.ctl[51] - ai.ctl[52]
reserved for backup/restore utility
ai.ctl[53]
reserved for V+ Developer
ai.ctl[54] - ai.ctl[111] and ai.ctl[128] - ai.ctl[199]
reserved for future use by Adept
ai.ctl[112] - ai.ctl[127]
reserved for menu page scratch variables
ai.ctl[200] - ai.ctl[255]
reserved for operator control panels

Each array reserves the values from index 112 to 127 for use when an individual menu page is displayed. Customizers can use these values but should assume the values are not usable once the menu page has been closed.

Control values at indexes higher than 255 are available for customizers' use. Since arrays are dynamically allocated in V+, memory restrictions are the only constraint on the number of control values available.

Global variables for the system state control indexes are initialized by the programs ai.cv.define( ) and ai.cs.define( ) in the PUBLIC.OV2 file. You can use these values in your custom programs, but do not change their values.

If you alter a numeric control value from a user written program, the ai.ctl[ ] value should not be changed directly but through a call to:

	ai.set.ctl() 

See ai.set.ctl (index, value)( ) for the calling requirements.

The programs cu.cs.define( ) and cu.cv.define( ) in the file CUSTOM.V2 are called during AIM initialization. You may edit these files (which have no Adept definitions) to define additional control values and index variables.