Progress
Programming
Handbook


Attributes in Expressions

An attribute reference can appear in an expression to yield an attribute value only. The attribute separator (:) is not an expression operator. It can only separate an attribute name from the name of the widget or handle variable to which it applies. Thus, it cannot reference an attribute of a widget handle value that is, itself, the result of an expression. This example shows a valid attribute reference in an expression.

DEFINE VARIABLE WidthTotal AS DECIMAL.
DEFINE BUTTON bChoose LABEL "Choose Me".
DEFINE FRAME Aframe bChoose.
WidthTotal = 5 * (bChoose:WIDTH-CHARS + 1) + 2. 

This example shows an invalid attribute reference.

DEFINE VARIABLE WidthTotal AS DECIMAL.
DEFINE BUTTON bChoose LABEL "Choose Me".
DEFINE FRAME Aframe bChoose.
WidthTotal = (bChoose:FRAME):WIDTH-CHARS. 

You cannot use the widget handle value returned by bChoose:FRAME to directly reference the WIDTH–CHARS attribute. You can, however, assign bChoose:FRAME to a widget-handle variable and use that variable for your attribute reference. For more information on widget-handle variables, see the "Handles" section.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095