TryMove() 공개 메소드

Like Cursor.Move, but returns false only if cursor points to the first (or last) item, and a move to the previous (or next) item was requested (i.e., when ups_cursor_move returns UpsConst.UPS_KEY_NOT_FOUND).
public TryMove ( byte &key, byte &record, int flags ) : bool
key byte
record byte
flags int
리턴 bool
예제 #1
0
 private void TryMove()
 {
     Cursor c = new Cursor(db);
     byte[] k1 = BitConverter.GetBytes(1UL);
     byte[] r1 = BitConverter.GetBytes(2UL);
     db.Insert(k1, r1);
     byte[] k2 = null, r2 = null;
     Assert.IsTrue(c.TryMove(ref k2, ref r2, UpsConst.UPS_CURSOR_NEXT));
     checkEqual(k1, k2);
     checkEqual(r1, r2);
     Assert.IsFalse(c.TryMove(ref k2, ref r2, UpsConst.UPS_CURSOR_NEXT));
     Assert.IsNull(k2);
     Assert.IsNull(r2);
 }