RDD

DbSetOrder()

Set the controlling order

Syntax

Signature
DbSetOrder( nOrderNum ) --> NIL

Arguments

nOrderNum

Position of the order in the current order list.

Return value

NIL.

Description

DbSetOrder() selects nOrderNum from the current order list as the controlling order. It changes the order used by DbSkip(), DbSeek() and related navigation; it does not rewrite records or move the pointer by itself.

Notes

The order must already be present in the order list. An invalid number or closed area raises an error. DbSetOrder() selects by position; OrdSetFocus() can select by name or position and returns the previous order name.

Example

DbSetOrder.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   DbSetOrder( 1 )
   QOut( "Order set" )
   DbCloseArea()

RETURN

Output

See also