[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SET ORDER command
Select the controlling Order
------------------------------------------------------------------------------
Syntax
SET ORDER TO [<nOrder> | [TAG <cOrderName>]
[IN <xcOrderBagName>]]
Arguments
TAG is an optional clause that provides compatibility with RDDs that
access multiple-Order Order Bags. You must use this keyword anytime you
specify <cOrderName>.
<cOrderName> is the name of an Order, a logical arrangement of a
database according to a keyed pair. This Order will become the
controlling Order in the Order List. If you specify <cOrderName>, you
must use the keyword TAG.
Note: This differs from dBASE and FoxPro where TAG is totally
optional.
<nOrder> is the number of the target Order in the Order List.
You may represent the Order as an integer or as a character string
enclosed in quotes.
IN <xcOrderBagName> is the name of a disk file containing one or
more Orders. You may specify <xcOrderBagName> as the filename with or
without the pathname or appropriate extension. If you do not include
the extension as part of <xcOrderBagName> CA-Clipper uses the default
extension of the current RDD.
Description
When you SET ORDER TO a new controlling Order (index), all Orders are
properly updated when you either append or edit records. This is true
even if you SET ORDER TO 0. After a change of controlling Order, the
record pointer still points to the same record.
SET ORDER TO 0 restores the database access to natural order, but leaves
all Orders open. SET ORDER TO with no arguments closes all Orders and
empties the Order List
Though you may use <cOrderName> or <nOrder> to specify the target Order,
<nOrder> is only provided for compatibility with earlier versions of
CA-Clipper. Using <cOrderName> is a surer way of accessing the correct
Order in the Order List.
If you supply <xcOrderBagName> only the Orders belonging to
<xcOrderBagName> in the Order List are searched. Usually, you need not
specify <xcOrderBagName> if you use unique Order Names throughout an
application.
To determine which Order is the controlling Order use the ORDSETFOCUS()
function.
In RDDs that support production or structural indexes (e.g., DBFCDX,
DBPX), if you specify a Tag but do not specify an Order Bag, the Tag is
created and added to the index. If no production or structural index
exists, it will be created and the Tag will be added to it. When using
RDDs that support multiple Order Bags, you must explicitly SET ORDER (or
ORDSETFOCUS()) to the desired controlling Order. If you do not specify
a controlling Order, the data file will be viewed in natural Order.
SET ORDER can open Orders in a network environment instead of the INDEX
clause of the USE command. Generally, specify USE, then test to
determine whether the USE succeeded. If it did succeed, open the
associated Orders with SET ORDER. See the example below.
Examples
USE Customer NEW
IF (! NETERR())
SET ORDER TO Customer
ENDIF
SET ORDER TO "CuAcct" // CuAcct is an Order in Customer
Status: Enhanced
See also: INDEX, INDEXORD(), SEEK, SET INDEX, USE
See Also:
INDEX
INDEXORD()
SEEK
SET INDEX
USE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson