xHarbour Reference Documentation > Command Reference |
Changes the current work area.
SELECT <nWorkArea> | <cAliasName>
The value 0 has a special meaning: it selects the next unused work area disregarding its work area number.
Note: both work area number or alias name can be specified as literal value or as expression enclosed in parentheses.
The SELECT command is used to select the current work area. A work area is a logical entity where database files are open along with their accompanying files, like memo or index files. The maximum number of work areas is restricted to 65535.
Work areas can be selected using their numeric identifier. When a work area is occupied by an open database, it can be selected using the alias name specified with the USE command. The alias name is a powerful means for executing expressions in a work area that is not the current one. All that is required is to enclose an expression in parentheses and prefix it with the alias name and alias operator.
See also: | Alias(), DbSelectArea(), Select(), SET INDEX, USE, Used() |
Category: | Database commands |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates how different operatations can be coded // for multiple work areas. PROCEDURE Main SELECT 1 USE Customer ALIAS Cust ? Select() // result: 1 USE Invoice ALIAS Inv NEW ? Select() // result: 2 USE Sales NEW ? Select() // result: 3 SELECT Cust ? LastRec() // result: 200 ? Inv->(LastRec()) // result: 369 CLOSE ALL RETURN
http://www.xHarbour.com