Click or drag to resize

DbGoto Function (Usual)

X#
Move to a record specified by record number.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION DbGoto(
	uRecID AS USUAL
) AS LOGIC
Request Example View Source

Parameters

uRecID
Type: Usual
The record number to go to.
If uRecID does not exist, the work area is positioned to LastRec() + 1, and both EOF() and BOF() return TRUE.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks

By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying it within an aliased expression or by calling the overload that accepts a workarea parameter (a workarea number or alias ).
DbGoTo() performs the same function as the GO command.
For more information, refer to the GO command.
Tip Tip
Logical records: DBGoTo() does not respect logical visibility. That is, if the specified record exists, it will become the current record regardless of any order or filter condition. Shared mode: For a shared file, moving to a different record can cause updates to the current record to become visible to other processes.
Examples
The following example uses DbGoTo() to iteratively process every fourth record:
X#
1DBUseArea(TRUE, "DBFNTX", "sales", "Sales", TRUE)
2// Toggle every fourth record
3DO WHILE !EOF()
4    DBGoTo(RecNo() + 4)
5    Sales->Group := "Bear"
6ENDDO
See Also