Kbase 13361: Use of ENTERED in DICTIONARY VALIDATION gives compiler error
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Use of ENTERED in DICTIONARY VALIDATION gives compiler error
If you use the ENTERED function in your Dictionary validation code,
the compiler will give you errors depending on where the field has
been enabled.
The example given here uses UIB-generated code.
For instance, in the "sports" database, a user might attempt to
enter the following as Dictionary validation for customer.cust-num:
NOT cust-num ENTERED OR cust-num > 0
The user may then enclose the ENABLE_UI, DISABLE_UI, and WAIT-FOR in
the Main Block with a DO block:
DO WITH FRAME {&FRAME-NAME}:
END.
Running this "as is" from the UIB will give the following compiler
errors:
** No corresponding input field found for Customer.Cust-Num (88)
** Unable to analyse Dictionary validate expression for field
Cust-num (575)
** Could not understand line xxx. (196)
If the user then moves the *entire* ENABLE_UI internal procedure to
appear someplace prior to the Main Block, running the result will
*not* give errors.
This is *not* a bug, however. Validation (in the Dictionary or
elsewhere) needs to be at the same level of procedure as the frame
definition. When validation is executed, Progress switches the
current context to the frame's context. If the validation was not
compiled with the frame's context then the compiler thinks there's a
problem. Further troubles ensue because the FORM statement or DEFINE
FRAME statement cannot automatically compile in Dictionary
validation -- Progress will only do that if the statement is
ENABLE, PROMPT, SET, or UPDATE. (To do otherwise would result in
huge r-code for report-type .r's.)
Progress Software Technical Support Note # 13361