ordCreate()

ORDCREATE()

Create an Order in an Order Bag

Syntax

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

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.

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

Compliance

Clipper

Platforms

All

Files

Library is rdd

Seealso

DBCREATEINDEX(), ORDNAME(), ORDSETFOCUS()

SP_PROGON

PROGON()

  Short:
  ------
  PROGON() Initialize and display a progress bar box

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGON([cMessage])

  Description:
  ------------
  Places a progress box on the screen for use by
  PROGDISP()

  [cMessage] is an optional box title

  Examples:
  ---------

   //--------- this just shows progress from 1 - 1000
   initsup()
   ProgOn("Test")
   for i = 1 to 1000
     ProgDisp(i,1000,{||alltrim(str(i))+" of 1000"} )
   next
   ProgOff()

   //-------- this show indexing progress
   use Customer
   ProgOn("Index")
   dbcreateindex("Eraseme","(LNAME)",  ;
    {||ProgDisp( recno(),recc() ),LNAME},.f.)
   ProgOff()

  Source:
  -------
  S_PROG.PRG

See also : PROGCOUNT(), PROGDISP(), PROGEVAL(), PROGINDEX(), PROGOFF()

SP_PROGOFF

PROGOFF()

  Short:
  ------
  PROGOFF() Removes a progress bar box created by PROGON()

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGOFF()

  Description:
  ------------
  Removes the progress box placed on the screen by
  PROGON()

  Examples:
  ---------

   //---------- this just shows progress from 1 - 1000
   initsup()
   ProgOn("Test")
   for i = 1 to 1000
     ProgDisp(i,1000,{||alltrim(str(i))+" of 1000"} )
   next
   ProgOff()

   //---------- this shows indexing progress
   use Customer
   ProgOn("Index")
   dbcreateindex("Eraseme","(LNAME)",  ;
    {||ProgDisp( recno(),recc() ),LNAME},.f.)
   ProgOff()

  Source:
  -------
  S_PROG.PRG

See also : PROGCOUNT(), PROGDISP(), PROGEVAL(), PROGINDEX(), PROGON()

C5_DBCREATEINDEX

 DBCREATEINDEX()
 Create an index file
------------------------------------------------------------------------------
 Syntax

     DBCREATEINDEX(<cIndexName>, <cKeyExpr>,
        [<bKeyExpr>], [<lUnique>]) --> NIL

 Arguments

     <cIndexName> is a character value that specifies the file name of
     the index file to be created.

     <cKeyExpr> is a character value that expresses the index key
     expression in textual form.

     <bKeyExpr> is a code block that expresses the index key expression
     in executable form.

     <lUnique> is an optional logical value that specifies whether a
     unique index is to be created.  If <lUnique> is omitted, the current
     global _SET_UNIQUE setting is used.

 Returns

     DBCREATEINDEX() always returns NIL.

 Description

     DBCREATEINDEX() creates an index for the database (.dbf) file associated
     with the current work area.  If the work area has active indexes, they
     are closed.  After the new index is created, it becomes the controlling
     index for the work area and is positioned to the first logical record.

     DBCREATEINDEX() performs the same function as the standard INDEX
     command.  For more information, refer to the INDEX command.

 Notes

     .  Side effects: DBCREATEINDEX() is guaranteed to create an index
        that, when made active, will impose the specified logical order on
        the database.  The key expression is not necessarily evaluated at any
        particular time, by any particular means, or on any particular record
        or series of records.  If the key expression relies on information
        external to the database file or work area, the effect is
        unpredictable.  If the key expression changes the state of the work
        area (e.g., by moving to a different record or changing the contents
        of a record), the effect is unpredictable.

     .  Evaluation context: When the key expression is evaluated, the
        associated work area is automatically selected as the current work
        area before the evaluation; the previously selected work area is
        automatically restored afterward.

     .  Network environment: DBCREATEINDEX() creates the new index for
        the exclusive use of the current process.

     .  Illegal expression: If <cKeyExpr> evaluates to an illegal
        expression, the code block will always evaluate to end-of-file (EOF).

 Examples

     .  This example creates an index file, Name, indexed on the Name
        field:

        USE Employees NEW
        DBCREATEINDEX( "Name", "Name", { || Name })

 Files   Library is CLIPPER.LIB.

See Also: DBCLEARIND() DBREINDEX() DBSETINDEX() DBSETORDER()