Consultor Eletrônico



Kbase 13484: embedding PRIVATE-DATA within an expression gives error 247
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
embedding PRIVATE-DATA within an expression gives error 247


When using a widget's PRIVATE-DATA attribute within a 4GL expression,
it is valid only to use it as a setable on the left-hand side of the
expression.

In other words, the following statement *is* allowed:

select-1:PRIVATE-DATA = "My private data".


This statement, however, is not:

ENTRY(3, select-1:PRIVATE-DATA) = "Private item".


Why? In the case of the ENTRY function, when ENTRY(arg1,arg2) is used
on the left-hand side of an assignment, it causes an update to arg2,
so arg2 must be writeable. You might think that select-1:PRIVATE-DATA
*is* writeable, since it is a user-settable attribute. However,
PROGRESS does not support the writeability of :PRIVATE-DATA unless
it itself appears stand-alone on the left-hand side of an assignment.

The compiler assumes that all WIDGET:ATTRIBUTE constructs are read-
only expressions when they appear embedded somewhere in another
expression. This is because the expression evaluator never stops to
do an update during expression evaluation. When special functions
appear to the *left* of an assignment, PROGRESS has very specialized
code that looks for just those functions: WIDGET:ATTRIBUTE, ENTRY,
SUBSTR, PROPATH, etc. Anything else gets rejected.

The workaround is to use an intermediate variable, as in:

DEF VAR c AS CHAR.

c = SELECT-1:PRIVATE-DATA
ENTRY(3, c) = "Private item".
SELECT-1:PRIVATE-DATA = c.

Progress Software Technical Support Note # 13484