Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknown (array) Undefined

Status
Not open for further replies.

robrts

Programmer
Aug 26, 2002
28
US
I am currently supporting a number of applications written in Fox 2.5b DOS.

When compiling these applications I get an error message:
Unknown (an array name) - Undefined

These occur for every report that has been created and that uses an array for printing addresses, etc.
In a .PRG or in a screen all I would have to do is add an EXTERNAL command with the array name and that resolves it. I cannot remember what to do for reports (if anything can be done).

Thanks.
Robert
 
You do basically the same thing that you did in the PRG's.

You put EXTERNAL ARRAY <ArrayName> into the screen's Setup snippet.

Good Luck,
JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
In the program that calls the report, you may be able to issue a command like:

EXTERNAL REPORT MyRpt

So the project manager will pick it up. I forget.
I once got around it by having a dummy proc file with a dummy function:

*... main.prg
*... real code here
SET PROCEDURE TO dummy
SET PROCEDURE TO procfile
*... more real code here


*...dummy.prg
PROCEDURE aList
PROCEDURE aList2
*... other procs (arrays) here
*... end proc

Ugly, but oh well.
Dave S.
 
Thanks for the attempt

Unfortunately for reports that does not work. Per FoxPro help

&quot;ARRAY ArrayList
When an array is created in a program and then used in a lower-level program, include ARRAY with the array name in the lower-level program. ArrayList may contain a list of array names separated by commas. &quot;

I was just trying to see if anyone had ever come up with a workaround. Looks like the alternatives are:
1) Replace all the array items with individual variables
2) Live with the fact that some compile errors cannot be resolved.

If anyone else has other alternatives or ideas I would be happy to entertain them.

Thanks

Robert

Ps. Application works correctly, but Dev Mgr wants clean compiles.

Thanks




 
Robert,
A simple way to fix this is use a UDF() to &quot;front&quot; for the array. i.e. If in the report you now have a reference like myArray[1,2], change it to UDFmyArr(1,2). Then make a program file:
Code:
*UDFmyArr.PRG
PARAMETERS p_nRow, p_nCol
EXTERNAL ARRAY myArray

RETURN myArray[p_nRow, p_nCol]
Just make sure myArray[] is in scope for the report.

Rick
 
The best way to deal with the Report is to use single memory variables.

Just prior to issuing your REPORT FORM .... command assign the variable(s) the appropriate value(s) from the array.

Good Luck,
JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Thanks for all the thoughts.
Pretty much the same ideas I had.

Robert
 
Solved! thread184-911454

"At the bottom of your Main.prg, put the following:

PROCEDURE Dummy
PUBLIC A_REPT[1]


Because you never make a call to Dummy, the array will not actually be PUBLIC, but the compiler will stop complaining."
Craig Berntson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top