# ORDCREATE()

Create an Order in an Order Bag

Syntax

  ORDCREATE(<cOrderBagName>,[<cOrderName>], <cExpKey>,
  [<bExpKey>], [<lUnique>]) --> NIL

Arguments

  <cOrderBagName> Name of the file that contains one or more Orders.
  <cOrderName> Name of the order to be created.
  <cExpKey> Key value for order for each record in the current work area
  <bExpKey> Code block that evaluates to a key for the order for each record in the work area.
  <lUnique> Toggle the unique status of the index.

Returns

  ORDCREATE() always returns NIL.

Description

  This function creates an order for the current work area.It is similar to the DBCREATEINDEX() except that this function allows different orders based on the RDD in effect.The name of the file <cOrderBagName> or the name of the order <cOrderName> are technically both considered to be "optional" except that at least one of two must exist in order to create the order.
  The parameter <cExpKey> is the index key expression;typically in a .DBF driver,the maximum length of the key is 255 characters.
  If <bExpKey> is not specified,then the code block is create by macro expanding the value of <cExpKey>.
  If <lUnique> is not specified,then the current internal setting of SET UNIQUE ON or OFF will be observed.
  The active RDD driver determines the capacity in the order for a specific order bag.
  If the name <cOrderBagName> is found in the order bag can contain a single order,the the name <cOrderBagName> is erased and a new order is added to the order list in the current or specified work area.On the other hand,if it can contain multiples tags and if <cOrderBagName> does not already exist in the order list,then it is added.It is does exist,then the <cOrderBagName> replaces the former name in the order list in the current or specified work area.

Examples

          USE TESTS VIA "DBFNDX" NEW
          ORDCREATE( "FNAME",, "Tests->fName" )

          USE TEsts VIA "DBFCDX" NEW
          ORDCREATE( , "lName", "tests->lName" )
    Tests
          See examples

Status

  Started

Compliance

  This function is Ca-Clipper compliant

Platforms

  All

Files

  Library is rdd

See Also

- DBCREATEINDEX()
- ORDNAME()
- ORDSETFOCUS()