Move() public méthode

Moves the Cursor to the direction specified in the flags
This method wraps the native ups_cursor_move function. Moves the Cursor. Use the flags to specify the direction. After the move, use Cursor.GetKey and Cursor.GetRecord to retrieve key and record of the item. If the direction is not specified, the Cursor will not move.
/// /// /// if the Cursor points to the first (or last) item, and a /// move to the previous (or next) item was requested /// ///
public Move ( int flags ) : void
flags int The direction for the move. If no direction /// is specified, the Cursor will remain on the current position. /// Possible flags are: /// /// positions /// the Cursor to the first item in the Database /// positions /// the Cursor to the last item in the Database /// positions /// the Cursor to the next item in the Database; if the Cursor /// does not point to any item, the function behaves as if /// direction was . /// positions /// the Cursor to the previous item in the Database; if the Cursor /// does not point to any item, the function behaves as if /// direction was . /// skips /// duplicate keys of the current key. Not allowed in combination /// with . /// only /// moves through duplicate keys of the current key. Not allowed /// in combination with /// . /// ///
Résultat void
Exemple #1
0
 private void MoveNegative()
 {
     Cursor c = new Cursor(db);
     try {
         c.Move(UpsConst.UPS_CURSOR_NEXT);
     }
     catch (DatabaseException e) {
         Assert.AreEqual(UpsConst.UPS_KEY_NOT_FOUND, e.ErrorCode);
     }
 }
Exemple #2
0
        private void Move()
        {
            Cursor c = new Cursor(db);
            byte[] k = new byte[5];
            byte[] r = new byte[5];

            k[0] = 0;
            db.Insert(k, r);
            k[0] = 1;
            db.Insert(k, r);
            k[0] = 2;
            db.Insert(k, r);
            k[0] = 3;
            db.Insert(k, r);
            k[0] = 4;
            db.Insert(k, r);

            c.Move(UpsConst.UPS_CURSOR_NEXT);
            c.Move(UpsConst.UPS_CURSOR_NEXT);
            c.Move(UpsConst.UPS_CURSOR_PREVIOUS);
            c.Move(UpsConst.UPS_CURSOR_LAST);
            c.Move(UpsConst.UPS_CURSOR_FIRST);
        }