Click or drag to resize

DbSelect Function

X#
Select a new work area and retrieve the current work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION DbSelect(
	nNew
) AS DWORD CLIPPER
Request Example View Source

Parameters

nNew (Optional)
Type: Usual
The work area number for the new work area.

Return Value

Type: DWord
The work area number for the old work area.
Remarks
DBSelect() allows you to change the current work area and also retrieve the number of the current work area.
This is useful in a group programming project or when writing black-box general routines: each time a module changes the environment by selecting a new work area, you must save and restore the old environment.
Examples
The following example sets a new work area and stores the number of the current work area:
X#
1nOld := 0
2nNew : = 10
3nOld := DBSelect(nNew)
4...
5// Restore the old work area
6DBSelect(nOld)
7? "New work area            :", Select()
8? "Workarea selected before :", nOld
See Also