# ORDLISTADD()

Add Orders to the Order List

Syntax

  ORDLISTADD(<cOrderBagName>
  [, <cOrderName>]) --> NIL

Arguments

  <cOrderBagName> is the name of a disk file containing one or more Orders. You may specify <cOrderBagName> as the filename with or without the pathname or appropriate extension. If you do not include the extension as part of <cOrderBagName> HARBOUR uses the default extension of the current RDD.
  <cOrderName> the name of the specific Order from the Order Bag to be added to the Order List of the current work area. If you do not specify <cOrderName>, all orders in the Order Bag are added to the Order List of the current work area.

Returns

  ORDLISTADD() always returns NIL.

Description

  ORDLISTADD() is an Order management function that adds the contents of an Order Bag , or a single Order in an Order Bag, to the Order List. This function lets you extend the Order List without issuing a SET INDEX command that, first, clears all the active Orders from the Order List.
  Any Orders already associated with the work area continue to be active. If the newly opened Order Bag contains the only Order associated with the work area, it becomes the controlling Order; otherwise, the controlling Order remains unchanged.
  After the new Orders are opened, the work area is positioned to the first logical record in the controlling Order.
  ORDLISTADD() is similar to the SET INDEX command or the INDEX clause of the USE command, except that it does not clear the Order List prior to adding the new order(s).
  ORDLISTADD() supersedes the DBSETINDEX() function.
  The active RDD determines the Order capacity of an Order Bag. The default DBFNTX and the DBFNDX drivers only support single-Order Bags, while other RDDs may support multiple-Order Bags (e.g., the DBFCDX and DBPX drivers). 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.

Examples

         In this example Customer.cdx contains three orders, CuAcct,
          CuName, and CuZip.  ORDLISTADD() opens Customer.cdx but only uses the
          order named CuAcct:

          USE Customer VIA "DBFCDX" NEW
          ORDLISTADD( "Customer", "CuAcct" )
    Tests

Status

  Started

Compliance

Platforms

  All

Files

  Library is rdd

See Also

- DBSETINDEX()