Click or drag to resize

DbSelectArea Function

X#
Change the current work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION DbSelectArea(
	uArea
) AS LOGIC CLIPPER
Request Example View Source

Parameters

uArea (Optional)
Type: Usual
A number that specifies the work area to be selected. or the alias of the work area to be selected.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
DBSelectArea() causes the specified work area to become the current work area.
All subsequent database operations will apply to this work area unless another work area is explicitly specified for an operation. DBSelectArea() performs the same function as the SELECT command.
For more information, refer to the SELECT command.
Tip Tip
Selecting 0: Selecting work area 0 causes the lowest numbered unoccupied work area to become the current work area. Aliased expressions: The alias operator (->) can temporarily select a work area while an expression is evaluated and automatically restore the previously selected work area afterward.
Examples
The following example selects a work area via the alias name:
X#
1cLast := "Winston"
2DBUseArea(TRUE, "DBFNTX", "sales", "Sales", TRUE)
3Sales->DBSetIndex("salefnam")
4Sales->DBSetIndex("salelnam")
5DBUseArea(TRUE, "DBFNTX", "colls", "Colls", TRUE)
6Colls->DBSetIndex("collfnam")
7Colls->DBSetIndex("colllnam")
8DBSelectArea("Sales")        // Select Sales workarea
9DBSelectArea("Colls")        // Select Colls workarea
See Also