Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Undefined Arrays
Message
 
To
03/01/2002 12:24:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00600315
Message ID:
00600397
Views:
13
>>>I've been given a VFP 6 application to support. This was originally written in FPW 2.6, run through the converter, and then tweaked. I made a copy of the system and went to Rebuild the project. This generated a slew of "Undefined" errors - for example
>>>
>>>Program c:\hail\haililpb.spr has the following errors:
>>>    Unknown HSEL_ARR - Undefined
>>>
>>>
>>>I thought I knew what was causing that but each of the SPR's had an
>>>
>>>
EXTERNAL ARRAY hsel_arr
>>>
>>>line in it.
>>>
>>>I realize that these are warnings and the project should still compile correctly, but I'm curious as to what could be causing the message.
>>>
>>>Thanks for your responses......Rich
>>
>>Is the array actually external and passed as a parameter? Or is the array generated by the code with something like an SQL statement? If it's the latter, dimension the array prior to calling the statement that creates it.
>
>Thanks for responding.
>
>The array is created earlier. It isn't passed as a parameter but is referenced (via ALEN()) in this program.

The safe way to deal with it is to declare these unknown references (variables, external arrays) in a separate dummy procedure to fool the Project Manager. That procedure never gets called, but as long as it exists in the project it will not complain.

You can add it to the main program, for example.

PROCEDURE whatever && not called from anywhere.
cUnknown = "who_knows"
aUnknown[1] = "nothing"
RETURN

If they are unknown functions, you may define a dummy object in code, which never gets instantiated, and add that unknown function into a definition like this:

DEFINE CLASS dummy as Object
FUNCTION whatever
RETURN .F.
ENDFUNC
ENDDEFINE
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform