Consultor Eletrônico



Kbase P21277: How to get the field's screen-value knowing the name of the
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/15/2003
Status: Unverified

GOAL:

How to get the field's screen-value knowing the name of the field ?

FACT(s) (Environment):

Progress 9.1x

FIX:

The following function added to any container or viewer can be used to retrive the field handle by passing the field name.
Once you get the handle you can use it to get all the information available like:
screen-value, type, table, etc.

FUNCTION getFieldHandle
RETURNS HANDLE ( pc AS CHAR ) :
/*------------------------------------------------------------------------------
Purpose: Returns the field handle by knowing the field name
Notes:
------------------------------------------------------------------------------*/
DEF VAR vh AS HANDLE.
DEF VAR vhf AS HANDLE.
vhf = FRAME {&FRAME-NAME}:HANDLE.
vh = vhf:FIRST-CHILD.
IF vh:TYPE = "FIELD-GROUP" THEN vh = vh:FIRST-CHILD.
REPEAT WHILE VALID-HANDLE( vh ):
IF vh:TYPE = "fill-in" AND vh:NAME = pc THEN RETURN vh.
vh = vh:NEXT-SIBLING.
END.
RETURN ?. /* no field with that name in FRAME-NAME. */

END FUNCTION.