Equinox Online Help - Language Reference - A to Z

Home

SkipRecord

Applies to
SyntaxSkipRecord NumberExpression, [LockExpression]
Action[Statement] Skips over a specified number of records.
ScopeOnly usable in forms or subtables.
Notes

This function operates in a similar way to NextRecord and PreviousRecord, but can move the record pointer by several records rather than just one.

NumberExpression specifies the number of records skipped and may take positive and negative values. Positive values move the record pointer down the record list and negative values move it up. If NumberExpression is greater than the number of records above/ below the current record, the record pointer stops at the first/ last record.

LockExpression allows you to control locking on the new record and may take one of the following values:

  • 0 The specified record is selected and not locked.
  • 1 Equinox specified record, is selected and locked (if not already locked by another user).
  • 2 If the specified record is locked by another user, Equinox moves down (if NumberExpression is positive), or up (if NumberExpression is negative) until an unlocked record is located. The first unlocked record encountered is selected and locked.

If LockExpression is omitted, it defaults to zero.

Note that you only need to lock a record if you intend to edit its fields. If you only want to read values, it is not necessary to lock the record.

Also note that an applied lock is automatically released when a new record is selected. However, if required, you may manually release the lock before changing records, using the Unlock statement.

After the statement is executed, the SysError system workarea is set to one of the following values:

  • 0 The statement was executed successfully.
  • 1 An error occurred.
  • 2 This value is returned if LockExpression was set to 1, but the first record was already locked, ie the lock failed.
CategoryRecord navigation
See Also GroupFirstRecord, GroupLastRecord, GroupNextRecord, GroupPreviousRecord, GroupSkipRecord, LastRecord, NextRecord, PreviousRecord
Example

The following examples show how the statement could be used:

SkipRecord 1 | same as NextRecord
SkipRecord 10 | moves on ten records
SkipRecord -3 | moves back three records
SkipRecord 5, 1 | moves on five records and locks new record