RDD

OrdSetFocus()

Set the controlling order

Syntax

Signature
OrdSetFocus( [cOrderName | nOrder], [cOrderBagName] ) --> cPrevOrderNameInFocus

Arguments

Optional order selector and bag file.

Return value

Previously focused order name.

Description

Selects an order by name or position, optionally within a specified bag, and makes it controlling for navigation and searches. The record pointer stays in the current area, while the logical order used by later operations changes. The function returns the previous order name.

Notes

The selected order must be loaded. Invalid names, positions, bags or missing areas raise an error. DbSetOrder() selects only by numeric position.

Example

OrdSetFocus.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   QOut( "Previous order: " + OrdSetFocus( 1 ) )
   DbCloseArea()

RETURN

Output

See also