Command SELECT Foundation
Selects and activates a work area.
SELECT <nWorkArea> | <cAlias>
The file command SELECT selects a work area and sets it as the active work area. All functions called without the alias operator execute their operations in the active work area. Either the numeric value (ordinal number) of a work area or its alias name is specified in the command. When the value 0 is specified, the command selects the work area with the lowest ordinal number where no files are opened (the next free work area).
The functional equivalent of the command SELECT is the function DbSelectArea().
// The example illustrates various ways to call SELECT,
// as well as the effect of the alias operator.
PROCEDURE Main
LOCAL nWorkArea
USE Customer
? Select() // result: 1
? Alias() // result: CUSTOMER
SELECT (2)
USE Invoice ALIAS Inv
? Select() // result: 2
? Alias() // result: INV
USE Part ALIAS Part NEW
? Select() // result: 3
? Alias() // result: PART
SKIP
? Customer->(RecNo()) // result: 1
? Customer->(Select()) // result: 1
? Inv->(Select()) // result: 2
? nWorkArea := Select() // result: 3
SELECT Customer
? Alias() // result: CUSTOMER
? Select() // result: 1
? (nWorkArea)->(Alias()) // result: PART
? (nWorkArea)->(RecNo()) // result: 2
SELECT (nWorkArea)
? Alias() // result: PART
SELECT (0)
? Alias() // result: (null string(""))
? Select() // result: 4
CLOSE DATABASES
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.