Consultor Eletrônico



Kbase P105101: How to know the row number; in the browse viewport; of the row currently being displayed using code
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/7/2005
Status: Unverified

GOAL:

How to know the row number; in the browse viewport; of the row currently being displayed using code inside the ROW-DISPLAY trigger of a browse based on a dynamic query object?

FIX:

Assume that the following variables have been defined and the dynamic query has been created, opened and attached to the browse widget:
DEFINE VARIABLE hQueryHandle AS WIDGET-HANDLE. /* The dynamic Query handle */
DEFINE VARIABLE iBrowseNumberOfIterations AS INTEGER NO-UNDO INITIAL 7. /* Browse number of iterations */
DEFINE VARIABLE iQueryCurrentResultRowNumber AS INTEGER NO-UNDO. /* Number of row in the query result set */
DEFINE VARIABLE iCurrentRowNumberInViewPort AS INTEGER NO-UNDO. /* currently displayed row in the browse view port */
Then following code would message the currently displayed row in the browse widget view port. Notice that the Browse number of iterations can not be accessed inside the ROW-DISPLAY trigger, that is why we assumed that it has been initialized to 7 rows:
ASSIGN
iQueryCurrentResultRowNumber = hQueryHandle:CURRENT-RESULT-ROW
iCurrentRowNumberInViewPort = iQueryCurrentResultRowNumber MODULO iBrowseNumberOfIterations.
IF iCurrentRowNumberInViewPort = 0 THEN
iCurrentRowNumberInViewPort = iBrowseNumberOfIterations.
MESSAGE iCurrentRowNumberInViewPort
VIEW-AS ALERT-BOX INFO BUTTONS OK.