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!

How to get Project Manager to stop thinking 'error' 3

Status
Not open for further replies.

MossNelson

Programmer
Oct 30, 2003
26
US
I have a report which uses an array as one of it's sources. The report works fine but the Project Manager keep giving me an error which is nothing if not annoying.

The error is "reportname.frx has the following errors: Unknown A_REPT - Undefined"

I have tried placing "EXTERNAL ARRAY a_rept" statements in various places in the calling form but it doesn't work. I think I have about 10 of these now. Any ideas on how to resolve this?
 
>>> tried adding the EXTERNAL ARRAY statement to the main .prg? <<<

I just tried that. It did not help.
 
Looks like this is an old problem.
See this thread from the FoxPro (old versions) forum:
Unknown (array) Undefined
thread182-399154

rgbean's post seems to fix the problem.
 
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
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports&quot;
 
Craig,

>>> Because you never make a call to Dummy <<<
Wow! it's that simple.

Actually I feel like the dummy because I tried creating a PUBLIC array as an earlier solution but ran into an error 'Illegal Redefinition of Variable". I was defining the array as public in my report screen.

Creating a procedure with the variable as Public but never actually calling it resolves the issue nicely and is a good lesson to learn about the PM. Thanks for your help!

-NMOSS
 
Yes Craig you made a good point. I use a slightly different approach but the principle is the same.

The way I do this is create a seperate prg file called dummy.prg and put all these odds and ends in there. Then I add the prg to the project, but set it to Excluded. Compiler stops throwing a fit and I don't end up with extra code being compiled into my app or exe. That latter point is the only thing I see wrong with the approach you outlined Craig.

One of the other times I regularly got compile error before I started using a dummy.prg was when using API calls. The compiler is unable to see that these API functions are declared it throws a fit. So I create a bunch of dummy procedures in my dummy.prg such as:

PROCEDURE GETENVIRONMENTVARIABLE &&- Undefined
PROCEDURE VERIFYKEY &&- Undefined
PROCEDURE CHECKCODE &&- Undefined
PROCEDURE UPDATEENVIRONMENT &&- Undefined
PROCEDURE FINDWINDOW &&- Undefined
PROCEDURE SENDMESSAGE &&- Undefined
PROCEDURE SHELLEXECUTE &&- Undefined


boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top