Accessing a Database, AIM Variable, V+ Variable,
or ai.ctl[ ] Numeric ValueA number menu item allows displaying or updating of a database field value, AIM variable, V+ variable, or an ai.ctl[ ] value.
To create a new number menu item, display the menu page for which you want to create a menu item and select:
To edit an existing number, display the menu page the number menu item is on and select:
Figure 8-4. Accessing Numeric ValuesNumeric Value Options
Select the font number for the label and the displayed value.
Indicate the conditional section you want associated with this item. For details, see Creating a Conditional Section.
Enter the help search string associated with this item. When this item is selected and the F1 key is pressed, the help database associated with the menu page file will be searched for a record with this name. If a matching record is found, it will be displayed in the help window. See The Help Menu Page.
The upper left corner of the item is specified in the first two boxes. The width and height of the item are specified in the second two boxes.
Enter the label you want to display with the field. In the "Relative position" data boxes, enter the position for this label relative to the upper left corner of the field.
Double-click on Aa|Aa (next to Text color) to display a pop-up menu showing you the text and background color options. If Opaque is selected, the label will look like the left "Aa". Otherwise, it will look like the right "Aa".
If DB value is specified, data boxes will be displayed requesting a database type number, field number, and array index. This menu item will access a value in the specified database and field. If the field is an array field, specify the array element to access. To access the primary database, leave the database number blank (this field is almost always left blank).
If AIM variable is selected, a data box requesting the name of a Variable database record (from the current selected resource module) will be displayed and this menu item will display the value of this variable. To access the global Variable database, enter a colon ":" in front of the variable name. The total number of characters that can be entered into this field is 18.
If V+ variable is selected, a data box requesting the name of a global V+ variable will be displayed and this menu item will access the value of this variable. The total number of characters that can be entered into this field is 18.1
If ai.ctl[ ] value is selected, this menu item will access the value of the ai.ctl array cell indicated in "ai.ctl index".
6 The characteristics specified in this section are:
Sequence Idle Indicates that this field will not be editable when a runtime task is executing. (When this field is accessed during debug operation, a message indicating that the field cannot be changed will be displayed.)
Auto refresh When selected, the display of this number will be updated at the rate specified in the menu page header or whenever any value is entered on this page.
Auto redraw When selected, conditionals will be evaluated and the page redrawn each time this value is altered.
Required When selected, the field accessed by this item will be a required field. (The user will not be allowed to exit the menu page unless a valid entry is made or the database record is deleted.)
The characteristics specified in this section are:
Specify the required user access level before the value will be displayed.
Specify the required access level before the value can be modified.
If a value other than 0 is entered, the field will be interpreted as a bit field and the specified bit will be accessed. Bit 1 is the LSB.
Force this item to work in a radio group. Icons such as push buttons, radio buttons, and check boxes are the items most commonly used with radio groups. When one item from the group is selected, the value will be set to the "On" value, and all other members of the group will set their values to their "Off" values (item
). The "Input/Output Format" group on this menu page is an example of a radio group.
In "Chk. Rtn", specify a routine that will be run to perform data validation on the value entered (see menu.chk.spawn( ) in the AIM Customizer's Reference Guide). The value in "Arg" will be passed to the check routine.
If Check before display is selected, the check routine also will be run before the value is displayed.
This section specifies the formatting characteristics of the displayed value.
Icons such as "check_box", "radio_button", and "push_button" are used primarily as icons with number menu items. These icons can be displayed in different states depending on whether they are on or off. To define an icon for use with this option, use an icon array with the first four elements having the following meanings:
[0] Off, not selected
[1] Off, selected
[2] On, not selected
[3] On, selected
When an icon is on, the value will be set to the value in the first "On/Off" value data box. When the icon is off, the value in the second data box will be used.
When this option is selected, the specified value cannot be edited: It merely specifies an index into an icon array. This gives you a simple way to display different icons.
When F format is selected, specify the justification, limits, and decimal precision for a formatted decimal number.
Specify the justification and limits for a number to be displayed in the default decimal format. Numeric field output rounds fractional numbers to fit the field, if possible. For example, if the actual value is 3.0188 and the field width is 4, the value 3.02 is displayed.
Specify the justification and limits for a number to be displayed as a hexadecimal value.
Specify the justification and limits for a number to be displayed after being truncated to an integer.
Specify the justification and limits for a number to be displayed in octal format.
The following characteristics are not shown in item 9. These can be displayed using the scroll down arrow.
The value will be displayed as On (any nonzero number) or Off (zero).
The value will be displayed as Yes (any nonzero number) or No (zero). This menu item can be sized to display only Y or N.
The value will be displayed as Pass (any nonzero number) or Fail (zero). This menu item can be sized to display only T or F.
The keyword and keyword list options work in conjunction with the Keyword options described in AIM Keyword Lists. When one of these options is selected, data boxes for Keyword list and Idx will be displayed. These values are taken from the values specified in the routine ai.key.new( ) that sets up a new keyword list. For example, if you wanted to access the list created with:
ai.key.new($my.keyword[2,])you would specify "my.keyword" for the Keyword list and 2 for the Idx.2
The actual numeric source specified in item will contain the number of the element in the keyword list as set up by ai.key.add( ). For example, if:
ai.ctl[ ] index: = 200
ai.ctl[200] = 5
and you have added the following keywords:
ai.key.add($my.keyword[2,], "stuff", 5)
ai.key.add($my.keyword[2,], "junk", 6)
then "stuff" will be displayed as the keyword item. If "junk" is entered for the item value, ai.ctl[200] will receive the value 6. If an undefined array element is specified, question marks will be displayed.
The limits specify which elements will be considered.3 If 5 and 6 are entered for the limits, only elements 5 and 6 may be displayed or specified.
As in a keyword, the Keyword list and Idx data boxes specify the source for the keyword scrolling list. The numeric value source will contain the number of the highlighted element. Clicking on an element in the list will update the value of the numeric source to the number of the element. The limits specify the limits of the elements that will be displayed in the scrolling window.
If either of these options is selected, data boxes will be displayed asking you to specify the upper and lower limits and the slide arrow increment value.
This menu item will create a slide bar that will alter the database field, V+ variable, or ai.ctl[ ] value. The value corresponds to the position of the handle in the slide bar. However, the value will not be displayed. An additional menu item must be created to display the value.
This section specifies the units for the displayed value. The units are specified by choosing one of the keywords from the list below. Not all formats allow units scaling.
These keywords correspond to the default Adept units.
If one of the keywords in the list above appears in a label, proceeded by a "#", the "#" is removed and the appropriate units label is substituted. (The keywords "None" and "Special" cannot be used in this way.) If a "#" is seen that is not followed by one of the keywords, the string, including the "#", is displayed without changes.
For example, if the label string in the field definition is: "Angle (#deg)", the characters "#deg" are changed to "deg" if US angle scaling has been selected, or changed to "rad" if metric angle scaling has been selected. The label substitution occurs in any label field or static text field, regardless of whether or not the field itself is designated as having a units scale factor.
11 Use Justification to control the alignment of the displayed value-either left-aligned, centered, or right-aligned.
Use Low/High lim: to specify a low limit and/or a high limit for the value. An error will be automatically generated if either of these values is exceeded.
If Opaque bkgd. is selected, the background is automatically refreshed whenever the value is updated. This is useful when the value is being dynamically updated (such as a counter).
If Box value is selected, a border will be placed around the displayed value.
Note that the menu database can be altered to allow a greater number of characters in this field.
If a one-dimensional array is used, leave the "Idx" data box blank.
These are not numeric keyword values. They are index values from 1 to n indicating a subset of possible keywords.