Function DbGoTop() Foundation

Sets the record pointer to the first logical record.

Syntax
DbGoTop() --> NIL
Return

The return value of DbGoTop() is always NIL.

Description

The database function DbGoTop() moves the record pointer of a work area to the first logical record. When the function is used without the alias operator, the record pointer is moved in the current work area.

The command GO TOP can be used instead of DbGoTop(). GO TOP is effective only in the current work area.

After the termination of the function DbGoTop(), the record pointer is positioned on the first logical record. This is determined by the controlling index and/or by the active filter condition. When neither filter nor index exist, the function moves the record pointer to the first physical record.

Examples
Logical begin of file

// In the example, DbGoTop() is used on a file without 
// and then with a filter condition set. After each 
// call of DbGoTop() the record pointer is positioned 
// to a different record. 

PROCEDURE Main 
   USE Customer NEW 

   Customer->( DbGoTop() ) 

   ? Customer->( RecNo() )    // result: 1 
   ? Customer->LastName       // result: King 
   SKIP -1 
   ? Bof()                    // result: .T. 

   SET FILTER TO SubStr(Customer->LastName,1) > "K" 
   Customer->( DbGoTop() ) 
   ? Customer->( RecNo() )    // result: 21 
   ? Customer->LastName       // result: Landers 
   SKIP -1 
   ? Bof()                    // result: .T. 

   CLOSE customer 
RETURN 
Feedback

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.