# Cruising and zooming commands

Most Update Processor commands work the same whether or not dictionary attributes are in
 control. Some commands function differently when certain conditions are met. These commands
 provide the functionality for browsing on indexes.

| Command | Description |
| --- | --- |
| CTRL+GG | The ability to move through a defined door to another file. After you access the other file, you have the option to cruise from item-to-item in the new file, return to the original file, or zoom to another file. When in an attribute that indexes to another file or has a translate code in the input processing code, the CTRL+GG command pushes the current process one level and calls the Update Processor again with the pointed to item in the new file as the argument. If the macro attribute (attribute 15) in the primary file attribute definition item is used, this list is appended to the update statement. This is known as zooming. Zooming is only available when done through the Update Processor and involves the use of the i (index, remote) processing code. |
| CTRL+F | In an indexed attribute, the sentence forward command goes to the next sequential index and gets the corresponding item into the Update Processor workspace. |
| CTRL+D | In an attribute with an index, the sentence backward command goes to the previous sequential index and gets the corresponding item into the Update Processor workspace. |
| CTRL+U | If the attribute indexes to another file, the word forward command gets the next sequential item from the pointed to file as the value for this attribute. |
| CTRL+Y | If the attribute indexes to another file, the word backward command gets the previous sequential item from the pointed to file as the value for this attribute. |

## Table Lookup

The *table lookup* command (CTRL+U) performs a table-like lookup of items in the remote
 index using either a full or partial key. You press the key followed by CTRL+U to call up
 the first match. If no match is found, the next item in the remote list is called up.

## Double-clutching

*Double-clutching* refers to the combined abilities of searching a remote file index
for valid values and also searching the local (current) file index
for specific items.

 The cruising commands can be used in a double-clutching fashion by specifying the index for
 the current file and a second index for another file. CTRL+U and CTRL+Y cruise on legal
 instances in the pointed to file, staying in the same item. CTRL+F and CTRL+D cruise on
 other items in the same file using the index for the attribute as a guide.

Double-clutching provides a unique feature when the local index is specified before the remote
 index in the input-conversion of an attribute definition. On a new screen: If a new value is
 entered at the attribute specified for double-clutching, and an item already exists on file
 containing this same value, that item is automatically retrieved by the Update Processor.

 For example: Consider an Update Processor entity screen where the phone attribute displays
 first. If this attribute is set up as described previously, and a user enters a phone number
 that is already on file, that item is retrieved. In this example, this feature prevents the
 entry of the same phone number for two different people.

This feature is only activated
on new, unchanged items.

Note: Specifying the remote index before
the local index disables this feature.

## Cruising

The key to *cruising* is understanding the Balanced Tree (B-tree) indexing feature of D3. A
 B-tree is a structure used to keep an ordered list, such as names, and provides the ability
 to search through the list quickly with a minimal number of disk I/Os. Any attribute in a
 file can contain an index. Indexes are defined using a-correlatives. After the B-tree has
 been defined, the system automatically maintains the index.

When the cursor is positioned in a cell belonging to an indexed attribute, the commands CTRL+D
 and CTRL+F can be used to display the data associated with the item containing an adjacent
 value in the indexed attribute.

- The command CTRL+D causes the data associated with the previous value in the index to be displayed.

- The command CTRL+F causes the data associated with the next value in the index to be displayed.

For example: If an item containing customer name and order number indexed attributes is being
 displayed on the screen and the cursor is at the order number prompt, the CTRL+F command
 displays the data associated with the next order number in the order number index. If the
 cursor is residing adjacent to customer name, CTRL+F displays the data associated with the
 next customer name in the index and customer name is the key. All of the data in the new
 item associated with the attribute names displayed on the screen displays.

When the input-conversion attribute in an attribute-defining
item specifies an index pointing to another file, that file can be
accessed (zoomed to) by using the CTRL+G command. This command pushes
the current process one level and accesses the item-ID in the pointed-to
file matching the current value in the cell where the cursor resides.
Attributes to be displayed with that item-ID must be specified in
attribute 15 of the original attribute-defining item. Several logical
views may be defined as macros in attribute 15 of the D-pointer.

A FlashBASIC program can be called to specify the actual logical view to use for the current data
 item. It does this by assigning the logical view number into the pseudo variable
 AQL (18). If no attributes are specified, the entire item displays.
 After viewing the new item, the original item can be returned to the screen by a file exit
 command such as CTRL+XE.

When the input-conversion attribute in an attribute-defining item specifies a second index, as
 well as one pointing to another file, the commands CTRL+U and CTRL+Y allow the user to
 cruise on indexes in the pointed-to file. The attribute pointed-to in the second file must
 have been previously indexed by the create-index command.

- The command CTRL+U shows the next attribute value in the pointed-to file. Only this value is updated and it is shown in the cell where the cursor is residing. What displays is subject to the conversions specified in the dictionary of the first file.

- The command CTRL+Y shows the preceding item-ID in the pointed-to file. For the Update Processor to function in this manner, the attribute-defining items must contain the proper index processing codes. The input conversion attribute (attribute 14) of the attribute-defining item in the file dictionary is where they are specified.

## Zooming

If you want to see detailed information about a specific file, you can set up zooming two
 different ways. Both methods provide the means to access additional file data.

- Set up a remote index: To set up a remote index to zoom, use an i command statement at the input-conversion line. For example: ```
 ifilename;a1
``` You can access a video demonstration here. In the demonstration, filename = products.

- Translate to the products file: To set up a translate to the products file to zoom, use a t command statement at the input-conversion line. For example: ```
 tfilename;x;;0
``` Important: If you use a translate to enable zooming, you must use a zero in the command statement if you do not want to change the data in the file.You can access a video demonstration here. In the demonstration, filename = products.

## See also

- [create-index command](https://d3codex.com/tcl/create-index-command/)
- [Cruising](https://d3codex.com/definitions/cruising/)
- [i (local index) processing code](https://d3codex.com/processingcodes/i-local-index-processing-code/)
- [i (remote index) processing code](https://d3codex.com/processingcodes/i-remote-index-processing-code/)
- [key statement](https://d3codex.com/pickbasic-flashbasic/key-statement/)
- [macro](https://d3codex.com/attributedefiningitem/macro/)
- [macro attribute](https://d3codex.com/updateprocessor/macro-attribute/)
- [Update processor overview](https://d3codex.com/updateprocessor/update-processor-overview/)
- [update command](https://d3codex.com/tcl/update-command/)

---
Source: https://d3codex.com/updateprocessor/cruising-and-zooming-commands/ - part of the D3Codex reference.
