Kbase P17567: How to get the number of the currently selected column of a
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/26/2003 |
|
Status: Unverified
GOAL:
How to get the number of the currently selected column of a regular (Not Smart) browse?
FIX:
Define an ENTRY event trigger for the browse with code similar to:
ON ENTRY OF BROWSE {&BROWSE-NAME}
ANYWHERE
DO:
DEFINE VARIABLE hColumn AS HANDLE NO-UNDO.
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.
ASSIGN
hColumn = SELF:HANDLE
iCounter = 1.
IF VALID-HANDLE(hColumn) AND hColumn:TYPE = "FILL-IN" THEN
DO WHILE hColumn <> {&BROWSE-NAME}:FIRST-COLUMN:
ASSIGN
iCounter = iCounter + 1
hColumn = hColumn:PREV-COLUMN.
END.
MESSAGE "Current column is column number: "
iCounter " of " {&BROWSE-NAME}:NUM-COLUMNS
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.