How to avoid compilation errors  with arrays in reports ?

Eduardo Fuerte
Eduardo Fuerte used Ask the Experts™
on
Hi Experts

How to avoid compilation errors  with arrays in reports ?
(According with the pictures, during project rebuild the arrays variables aren't  visible to compiler...) maybe an EXTERNAL directive but where ?
 Img report
img compiler error
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
CaptainCyrilFounder, Software Engineer, Data Scientist

Commented:
Well I would not use an array but a cursor instead. You can use another cursor with an alias like tmptotals or tmprecap.

I think your last row is the difference between the top two so you only need one row that is from the cursor and the other one calculated in report.

Row1 = Total
Row2 = Cursor
Row3 = Total-Cursor
To change every array into a cursor would be a boring work... You may also enclose it by EVALUATE() function:

EVALUATE("plan_mes[1]")

and the error will be suppressed but it belongs to the same category...

The easiest solution is to create a PRG file containing all array names as functions and add this file into a project:

DummyArrayFunctions.PRG:

FUNCTION plan_mes
FUNCTION disp_mes
FUNCTION m_null
FUNCTION dia
etc.
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Simply effective !

Congratulations

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial