Kbase P33546: ** Unable to understand after --
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  23/09/2003 |
|
Status: Unverified
FACT(s) (Environment):
Sun Solaris SPARC
FACT(s) (Environment):
Progress 9.1C
SYMPTOM(s):
** Unable to understand after -- "<string>". (247)
** <program> Could not understand line <number>. (198)
** Unable to understand after -- "i = NEXT-VALUE". (247)
** test.i Could not understand line 8. (198)
Running the the procedure test.p consisting of one include statement after connecting to the sports database:
/***test.p***/
{test.i }
Where the include file is:
/***test.i***/
DEFINE VARIABLE i AS INTEGER NO-UNDO.
FIND FIRST {&dbcon}Customer WHERE Cust-Num > 23 NO-LOCK NO-ERROR.
IF AVAIL {&dbcon}Customer THEN
MESSAGE {&dbcon}Customer.Cust-Num
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ASSIGN
i = NEXT-VALUE(Next-Cust-Num,{&dbcon}).
MESSAGE i
VIEW-AS ALERT-BOX INFO BUTTONS OK.
CAUSE:
In the statement: 'i = NEXT-VALUE(Next-Cust-Num,{&dbcon}).', the preprocessor name reference {&dbcon} evaluates to "" making NEXT-VALUE function syntax;
'NEXT-VALUE(Next-Cust-Num,)' wrong.
FIX:
Modify the include file to test whether the preprocessor name reference has been defined or not and use the appropriate syntax:
/***test.i***/
DEFINE VARIABLE i AS INTEGER NO-UNDO.
FIND FIRST {&dbcon}Customer WHERE Cust-Num > 23 NO-LOCK NO-ERROR.
IF AVAIL {&dbcon}Customer THEN
MESSAGE {&dbcon}Customer.Cust-Num
VIEW-AS ALERT-BOX INFO BUTTONS OK.
&IF DEFINED(dbcon) = 0 &THEN
i = next-value(Next-Cust-Num).
&ELSE
i = next-value(Next-Cust-Num,{&{&dbcon}}).
&ENDIF
MESSAGE i
VIEW-AS ALERT-BOX INFO BUTTONS OK.