Seek Row

SeeRow is specifically to let you page through a Category using a Rowset that is smaller than the RowCount. Here's the Doc: ICommenceCursor::SeekRow Long SeekRow(Long bkOrigin, Long nRows)

Seek to a particular row in the cursor.

Defined in: E:/DEV/PIM80/DOCS/DBAPI/PIMOA/CURSOR.D

Return Value

Returns Actual number of rows moved, -1 on error.

Parameters

bkOrigin

Position to move from.

Can be one of the following:

BOOKMARK_BEGINNING (0) - from first row

BOOKMARK_CURRENT (1) - from current row

BOOKMARK_END (2) - from last row

nRows

Number of rows to move the current row pointer.

Comments

For any cursor, there is a 'current row pointer'. When the cursor is created, this defaults to the first row. SeekRow will reposition the current row pointer. GetQueryRowSet, GetEditRowSet and GetDeleteRowSet will also advance the current row pointer. ==> Seek Row Approx lets you sample the Category. by Size. Half, 3/4 etc. Oddly, it might actually be faster to do a Binary search this way than Filter on the Name Field which can be very slow on a big category. Though, I agree, it does seem kind of wierd. I suspect Commence uses it internally and we just the freebie! Here's the Doc:

ICommenceCursor::SeekRowApprox Long SeekRowApprox(Long nNumerator, Long nDenominator)

Seek to an approximate position in the cursor.

Defined in: E:/DEV/PIM80/DOCS/DBAPI/PIMOA/CURSOR.D

Return Value

Returns Actual number of rows moved, -1 on error.

Parameters

nNumerator

Numerator for fractional position in the cursor.

nDenominator

Denominator for the fractional position in the cursor.

Alan

"Mark Petryk" wrote in message news:6a31a82b$51c7b12d$429c@vlad...

Is anyone using:

Long SeekRow(Long bkOrigin, Long nRows) Seek to a particular row in the cursor.

Long SeekRowApprox(Long nNumerator, Long nDenom) Seek to an approximate position in the cursor.

Does seek row allow me to seek to any row in the dataset? Can I always specify an origin of "0" and then seek to a specific row from there?

And, what is SeekRowApprox? I'm sure it has a use somewhere, but I'm not quite clear on why I might want to approximately seek to a row...

~mark





~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database Support User Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com