Click or drag to resize

DbSelect Function

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

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION DbSelect(
	 nNew AS USUAL
) AS DWORD
View Source

Parameters

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

Return Value

Type: UInt32
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#
nOld := 0
nNew : = 10
nOld := DBSelect(nNew)
...
// Restore the old work area
DBSelect(nOld)
? "New work area            :", Select()
? "Workarea selected before :", nOld
See Also