Create an index file

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


     <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.


     DBCREATEINDEX() always returns NIL.


     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.


     .  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).


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

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

 Files   Library is CLIPPER.LIB.


2 responses to “C5_DBCREATEINDEX

  1. Pingback: C5_UPDATE | Viva Clipper !

  2. Pingback: C5_SET UNIQUE | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.