> The selected data is then sent to a REPORT FORM. I am getting an error
> in the Project Manager similar to the following:
>
> Unknown LACOUNT - Undefined
>
> The LACOUNT is an array of summary statistics. How can I eleminate this
> error from being displayed? I don't know how to use the EXTERNAL ARRAY
> command from within a REPORT.
>
> Any ideas/solutions?
Just another reocurring bug. Just ignore it. They haven't fixed it since
2.0, and it works that way ever since. The project manager keeps
complaining, the reports keep working. Maybe (just maybe) there may be
couple of workarounds:
- put EXTERNAL ARRAY statement in the program calling the report
- use parentheses () instead of brackets [] to surround indices within
the report fields; thus you may confuse it with a function with a same
name as the array. This also requires making damn sure that such a
function is not accessible at runtime (rather tricky, really). The only
sure solution is to write a function which returns an array element, and
that function does have an External Array declaration.
I use this one:
* Statc.prg
*+ usage
* =statc(RowNo, @some_array [, column_no])
*-
para nIndexs, ArrRef, nColRef
if para()=2
nColRef=1
endif
external array ArrRef
* if array is one-dimensional
if alen(ArrRef,1)=alen(ArrRef)
retu iif(betw(nIndexs,1,alen(ArrRef)), ArrRef[nIndexs], " ??")
else
* array is two-dimensional. nColRef is not range-checked.
retu iif(betw(nIndexs,1,alen(ArrRef,1)), ArrRef[nIndexs,nColRef], " ??")
endif
It should return nth array element, or a "??" if it doesn't exist.