Consultor Eletrônico



Kbase P131433: 4GL/ABL: Error (232) evaluating an AND logical expression referencing fields of a not previously re
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/11/2009
Status: Verified

SYMPTOM(s):

4GL/ABL: Error (232) evaluating an AND logical expression referencing fields of a not previously referenced buffer.

** Missing FOR, FIND or CREATE for a table with Custnum in current block. (232)

** Missing FOR, FIND or CREATE for a table with <field> in current block. (232)

Checking the syntax or executing a statement similar to the following when the buffer is not previously referenced:
IF AVAILABLE(Customer) AND (Customer.NAME = 'Steve') THEN
MESSAGE "This statement generates error 232":U
VIEW-AS ALERT-BOX INFO BUTTONS OK.

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

CAUSE:

The above statement fails because it evaluates both sides of the AND Operator. This behavior was introduced in Progress 8.0 to support the Progress DataServers.

FIX:

Rewrite the code to avoid referencing the fields of a non exiting record. For example:
IF AVAILABLE(Customer) THEN
IF (Customer.NAME = 'Steve') THEN
MESSAGE "This avoids error 232":U
VIEW-AS ALERT-BOX INFO BUTTONS OK.
A second solution is to use the FIND statement to reference the buffer prior to the above offending code. For example:
FIND FIRST Customer NO-LOCK.
IF AVAILABLE(Customer) AND (Customer.NAME = 'Steve') THEN
MESSAGE "This statement generates error 232":U
VIEW-AS ALERT-BOX INFO BUTTONS OK.
A third solution is to use the AVAILABLE function to reference the buffer prior to the above offending code. For example:
DEFINE VARIABLE lGotCustomer AS LOGICAL NO-UNDO.
ASSIGN
lGotCustomer = AVAILABLE(Customer).
IF AVAILABLE(Customer) AND (Customer.NAME = 'Steve') THEN
MESSAGE "This statement generates error 232":U
VIEW-AS ALERT-BOX INFO BUTTONS OK.