Code Segment 64K problem

Chris Kelleher

Administrator
Staff member
No, there is no way to increase to size or number of code segments... the only solutions are to decrease the size of your code or to upgrade to 9.1C, which allows for multiple code segments (however, 9.1C r-code will then be incompable with eariler versions).
 

M-HT

Member
Hi,
you can overcome this problem by moving some code to internal procedures (each has it's own code segment) and/or by optimizing the code i.e. instead of:
i = 1.
j = 2.
k = "x".
use:
assign
i = 1
j = 2
k = "x"
.
it takes less space in action segment
 
Roman,

Thanks for the advice but we are over this kind of optimalisation and now are in the code segment which is really need. I was afraid that there is no other possibility, only to change the program structure.

Istvan:dead:
 

dancar

Member
Code Segments

IPs were the intended solution each with segment limit but best solution beyond that is to break up the procedure.
Use sub-procedure ie: Run proc-name{ IO-params ...} wherever possible and look for repeative code; Pre-processor usage may help.
Best solution in today's "OOPS" programming world ... adherance to the K.I.S.S. principle. (Something forgotten from years gone by as current resources seemed endless...)
-dc
 
Sorry, maybe I forgot an important thing.
The main part of the code segment is definitions and triggers - but not real procedures!

fi:
ON ENTRY ...
DO:
RUN Proc_...
END.

and not more than (we using lot of objects in a modul).

Now I'm thinking on using of PUBLISH/SUBSCRIBE. It can be the solution? In this case my problem is, how can I display a field from a super-procedure rutin on an unknown frame?

Thank,
Istvan
 

greuceanu

New Member
If you have a lot of objects and the associated UI triggers, you might want to move some part of your UI into suppress windows run persistently. Depending on the program's structure, this might require quite a lot of changes.

Regards.
 

greuceanu

New Member
A second thought on your code:
ON ENTRY ...
DO:
RUN Proc_...
END.

By removing the DO: END. statements, your r-code will become smaller, maybe insignificant, but if you have many triggers, it might help.
 
I tryed this programs on 9.1C and it's OK. Only a warning message, that the progress uses more than one code segment. But in the next 2 ours the expression segment was too small, but to solve this problem is really easier than the code segment thing.
Thanks to everybody for the advices.

Istvan:D
 
Top