Function DbSelectArea() Foundation
Selects a work area.
DbSelectArea( <nWorkArea> | <cAlias> ) --> NIL
The return value of DbSelectArea() is always NIL.
The function DbSelectArea() selects a work area and sets it as the current (active) work area. All functions called without the alias operator perform their operations in the current work area. The function receives either the numeric value (ordinal number) of a work area or its alias name. When the value 0 is passed to DbSelectArea(), the function selects the work area with the lowest ordinal number and no open files (the next free work area).
The command SELECT can be used instead of the function DbSelectArea().
// The example illustrates the effect of the function
// DbSelectArea() and of the alias operator
PROCEDURE Main
USE Customer NEW
USE Invoice NEW
? RecNo() // result: 1
? Select() // result: 2
DbSkip()
? RecNo() // result: 2
? Customer->(RecNo()) // result: 1
? Customer->(Select()) // result: 1
? Invoice->(Select()) // result: 2
DbSelectArea("Customer")
? RecNo() // result: 1
? Select() // result: 1
? (2)->(Alias()) // result: INVOICE
? (2)->(RecNo()) // result: 2
DbSelectArea(0)
? Alias() // result: (null string(""))
? Select() // result: 3
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.