Progress
Programming
Handbook


Methods in Expressions

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

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

This example shows an invalid method reference.

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

You cannot use the widget handle value returned from the GET–TAB–ITEM( ) method to directly reference the WIDTH–CHARS attribute. 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