Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>locate</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LOCATE


Syntax:     LOCATE [<scope>] FOR <condition> [WHILE <condition>]

Purpose:    To search for the first record in the current work area that
            matches the specified condition.

Argument:   <condition> specifies the next record to LOCATE within
            the given scope.

Options:    Scope: The <scope> is the portion of the current
            database file in which to perform the LOCATE.  The default
            scope is ALL.  Note that the scope applies only to the
            initial search and does not affect any subsequent CONTINUE
            statements.

Condition:  The WHILE clause specifies the set of records meeting the
            condition from the current record until the condition fails
            where the LOCATE can scan.  Note that the WHILE condition
            applies only to the initial search and does not affect any
            subsequent CONTINUE statements.

Usage:      When you first execute a LOCATE, it searches from the
            beginning record of the scope for the first matching record
            in the current work area.  It terminates when a match is
            found or the end of the LOCATE scope is reached.  If it is
            successful, the matching record becomes the current record
            and FOUND() returns true (.T.).  If it is unsuccessful,
            FOUND() returns false (.F.) and the positioning of the
            record pointer depends on the controlling scope of the
            LOCATE.

            Each work area can have its own pending LOCATE condition
            which remains active until you execute another LOCATE in the
            current work area or the application is terminated.

            LOCATE works in combination with CONTINUE.  Any time later,
            you can resume the search from the current record pointer
            position with CONTINUE.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   USE Sales
   ? LASTREC()                         && Result: 84

   LOCATE FOR Branch = "200"
   ? FOUND(), EOF(), RECNO()           && Result: .T. .F. 5

   LOCATE FOR Branch = "5000"
   ? FOUND(), EOF(), RECNO()           && Result: .F. .T. 85


See Also: CONTINUE FIND SEEK EOF() FOUND()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson