Consultor Eletrônico



Kbase P36006: ** Unable to understand after --
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/7/2003
Status: Unverified

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 10. (198)

Running the the procedure test.p consisting of an include statement while connected to two copies of the sports database, alpha.db and beta.db:

/***test.p***/
{test.i &dbcon = alpha.}

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 AVAILABLE {&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 "alpha." making NEXT-VALUE
function syntax; 'NEXT-VALUE(Next-Cust-Num,alpha.)' wrong.

FIX:

1. Modify test.p to pass a second preprocessor name reference
'ALPHA' that will store the logical database name needed in the NEXT-VALUE function call:

/***test.p***/
{test.i &dbcon = ALPHA. &dblogical = ALPHA}


2. Modify the test.i to use the newly defined preprocessor name reference {&dblogical} in the NEXT-VALUE function call:

/***test.i***/
DEFINE VARIABLE i AS INTEGER NO-UNDO.
FIND FIRST {&dbcon}Customer WHERE Cust-Num > 23 NO-LOCK NO-ERROR.
IF AVAILABLE {&dbcon}Customer THEN
MESSAGE {&dbcon}Customer.Cust-Num
VIEW-AS ALERT-BOX INFO BUTTONS OK.

ASSIGN
i = NEXT-VALUE(Next-Cust-Num,{&dblogical}).

MESSAGE i
VIEW-AS ALERT-BOX INFO BUTTONS OK.