SKIP

From Lianjapedia
Jump to: navigation, search

Purpose

Move the record pointer forwards and backwards in the active table

Syntax

SKIP [<expN>] [IN | ALIAS <workarea | alias>]

See Also

BOF(), EOF(), FOUND(), GOTO, LOCATE, RECNO(), REPLACE, SEEK, SET RELATION, SET SKIP

Description

The SKIP command moves the record pointer forwards or backwards in the currently selected table. The numeric expression <expN> can be positive or negative. If the SKIP command is issued with no numeric expression <expN> specified then the record pointer advances on to the next record. If the currently selected table is indexed, then the SKIP command follows the order of the master index. The SET ORDER TO command can be used to select which of the open index files should be the master or controlling index.

If the record pointer is currently positioned on the last record of the table and the SKIP command is issued, the EOF() function will return .T.. If the record pointer is currently positioned on the first record of the table, and the SKIP -1 command is issued, the BOF() function will return .T..

IN | ALIAS <workarea | alias>

The optional IN <workarea | alias> or ALIAS <workarea | alias> clause allows you to move the record pointer in a workarea other than the current workarea. The record pointer in the current workarea is not moved as a result of this option.

Example

use patrons index events, dates, names
m_event = event
do while .not. eof()
    display off date, event, name
    if m_event <> event
        ?
        m_event = event
    endif
    skip
enddo
// Another example
skip 9 in orders