Named Selections

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.5 (Modified)


Named selections provide an easy way to manipulate several selections simultaneously. A named selection is an ordered list of records for a table in a process. This ordered list can be given a name and kept in memory. Named selections offer a simple means to preserve in memory the order of the selection and the current record of the selection.

The following commands enable you to work with named selections:

COPY NAMED SELECTION

CUT NAMED SELECTION

USE NAMED SELECTION

CLEAR NAMED SELECTION

CREATE SELECTION FROM ARRAY

Named selections are created with the COPY NAMED SELECTION, CUT NAMED SELECTION and CREATE SELECTION FROM ARRAY commands. Named selections are generally used to work on one or more selections and to save and later restore an ordered selection. There can be many named selections for each table in a process. To reuse a named selection as the current selection, call USE NAMED SELECTION. When you are done with a named selection, use CLEAR NAMED SELECTION.

Note: Combining the statement SET QUERY DESTINATION(Into named selection;namedselection) with a search command (for example QUERY) can also be used to create a named selection. Refer to the description of the SET QUERY DESTINATION command.

Named selections can be process or interprocess in scope.

A named selection is an interprocess named selection if its name is preceded by the symbols (<>) — a "less than" sign followed by a "greater than" sign.

Note: This syntax can be used on both Windows and Macintosh. In addition, on Macintosh only, you can use the diamond (Option-Shift-V on US keyboard).

The scope of an interprocess named selection is identical to the scope of an interprocess variable. An interprocess named selection can be accessed from any process.

A named selection whose name is not prefixed with the symbols (<>) is process in scope and is available only within the process in which it was created.

With 4D Client and 4D Server, an interprocess named selection is available only to the processes of the client that created it. An interprocess named selection is not available to other client machines.

Warning: Creating a named selection requires access to the selection of the table. Since selections are kept on the server and a local process does not have access to server data, do not use named selections within local processes.

Named Selections and Sets

The differences between sets and named selections are:

A named selection is an ordered list of records; a set is not.

Sets are very memory efficient, because they require only one bit for each record in the file. Named selections require 4 bytes for each record in the selection.

Unlike sets, named selections cannot be saved to disk.

Sets have the standard Intersection, Union and Difference operations; named selections cannot be combined with other named selections.

The similarities between named selections and sets are:

Like a set, a named selection exists in memory.

A named selection and a set store references to a record. If records are modified or deleted, the named selection or the set can become invalid.

Like a set, a named selection "remembers" the current record as of the time the named selection was created.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next