Consultor Eletrônico



Kbase P11798: Error 3307 - Expression Code Segment (Ecode)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

SYMPTOM(s):

Error 3307 - Expression Code Segment (Ecode)

<segment-name> has exceeded its limit of <segment-size> bytes, in <file-name> at line # <line-number>. (3307)

Ecode segment has exceeded its limit of <segment-size> bytes, in <file-name> at line # <line-number>. (3307)

CAUSE:

ECODE stands for EXPRESSION CODE SEGMENT. Holds the executable expressions in Reverse Polish Notation (RPN) for the main procedure, all internal procedures, and all trigger blocks. An r-code file can have up to 248K of executable expressions.

So if a .r file has a lot of execution expressions (eg. calculations) then the ecode limit may be reached.

FIX:

The main way to avoid this is to call another .r code file with the execution expressions in it. You must break code into multiple persistent procedures and use the "RUN XXX.P SET SomeHandle" and "RUN SomeIP IN SomeHandle" syntax.

Other possible solutions are as follows:

1.Where you have many assignment statements, such as:

ASSIGN variable-a = variable-a + 1.
replace with an internal procedure to perform the same functionality, and call many times i.e.

RUN AddProc (INPUT-OUTPUT variable-a).

PROCEDURE AddProc:
DEFINE INPUT-OUTPUT PARAM var-a AS INT NO-UNDO.
    ASSIGN var-a = var-a + 1.
END PROCEDURE.
2.Look for expression statements that have multiple subexpression assignments, and if possible re-write these as a single statement. For example, if you have:

ASSIGN temp = a + b
     X = temp + c + d.
then try

ASSIGN X = a + b + c + d.