Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Undefined Array Error Message When Building EXEs
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00186239
Message ID:
00186475
Views:
15
Because the compiler sees both MyArray[1] and MyArray(1) as function calls, because it's stupid that way. This has been a known bug in the compiler for years, and is the reason (like Mark said) for the EXTERNAL ARRAY command in prg files. Unfortunately, there's nowhere in a report to put EXTERNAL ARRAY, so people have come up with all these kludges to get rid of the compile-time errors.

My take on the situation, is to say "to hell with it" and click "Ignore" on all the undefined errors from arrays in reports at compile time. Because if you ignore the error (which really isn't one), it causes no error at run-time.

Of course if it really is an error because you're referencing an array which isn't defined when the report is called, you need to deal with that. But if you know the error is just at compile-time, and you can harmlessly ignore it, why mess around with all this defining of phony procedures, prg files, etc.? Well, that's my opinion, anyway.

Rich.

>If that's the problem, why not just use MyArray[1] instead?
>
>-Michelle
>
>
>>Hi Mark,
>>
>>Here's the problem:
>>The array expression:
>>MyArray(1)
>>
>>looks exactly like the function call:
>>MyArray(1)
>>
>>VFP thinks this is supposed to be a function. Fox will not determine that it is an array because you DIMENSION'ed in earlier in the code. If it could, there would be no reason for the EXTERNAL ARRAY directive that is needed in PRG's.
>>
>>One way around, is to use EVAL() in the report expression:
>>
>>EVAL("MyArray(1)")
>>
>>Mark
>>
>>>Here is my problem, hopefully it's clearly defined:
>>>
>>>I've created a project that contains a report.
>>>That report directly references arrays.
>>>
>>>Every time I build the project into an EXE I get error messages informing me that the arrays are undefined.
>>>
>>>Is there any way to reference arrays in a report contained in a project and be able to build an EXE without getting those annoying errors?!?!
>>>
>>>I don't think its "unusual" to use arrays in reports -- I really find it hard to believe that the project manager will ALWAYS report array references as errors - but that seems to be the case!
>>>
>>>Anyone know how to get around this??
>>>
>>>--Mark
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform