skip()

Read(4126) Label: cursor, skip,

Here’s how to use skip() function.

cs.skip()

Description:

Get the number of records the cursor skips.

Syntax:

cs.skip(n;x)

Note:

The function skips n records of cursor cs or till x… has changed, and returns the number of records actually skipped. If all parameters are absent, return the number of remaining records and close the cursor.

Parameter:

cs

A cursor.

n

An integer.

x

An expression, by which cs is ordered. With x, n will be ignored.

Return value:

Integer

Example:

 

A

 

1

=demo.cursor("select EID, NAME,STATE from EMPLOYEE order by STATE")

Return a data retrieval cursor, which has 500 records ordered by STATE field. Its content is as follows:

2

=A1.skip(50;STATE)

Since parameter x is present, ignore parameter n to skip records in the cursor until STATE field value changes and return 4.

3

=A1.skip(20)

Skip 20 records.

4

=A1.skip()

As parameters are absent, return the rest of the records in the cursor, close the cursor, and return  476.

 

Related function:

cs.fetch()

db.cursor()