sx_GoTop

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_GoTop

VB Declaration

Declare Sub sx_GoTop Lib "Apollo9.dll" ()

C Declaration

VOID FAR PASCAL sx_GoTop (VOID);

Description

Goes to the first record in the file. If an order is active, the first logical record is retrieved. If no index, the first physical record is retrieved. A backwards skip from the top position will set sx_Bof True and the record pointer will be repositioned to the first record.

The record pointer is positioned on the first record in the file whenever the file is opened or whenever a single IDX or NTX index is opened with sx_IndexOpen (logical record 1). If a compound index is opened (CDX or NSX), an explicit tag must be selected with sx_SetOrder and sx_GoTop must be called to set the record pointer to the first logical record.

 

If sx_SetDeleted is True, and/or a filter is set with sx_SetFilter or sx_Query, or a scope is set, the record pointer will be positioned at the first record in the file that satisfies the imposed conditions.

VB Example

Sub ButtonTop_Click ()

sx_GoTop

Call sx_GetRecord(lRec)

BoxCust.Text = lRec.lCust

BoxName.Text = lRec.lName

BoxRecno.Text = Format$(sx_RecNo(), "###0")

End Sub

C Example

// set order to name and position to first record

sx_SetOrder(iNameNtx);

sx_GoTop();

See Also

sx_Bof, sx_Go, sx_GoBottom, sx_Query, sx_Skip, sx_SetDeleted, sx_SetFilter