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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
Hi People, I have been away a while.
I get a compile error when I pass an array from one method to another as a parameter.

Error example:
Visual Class Library c:\Myproject\libs\baseforms.vcx has the following errors:
Unknown LARRYCOLNAMES - Undefined


 
That's because the compiler doesn't know that the reference in the called method is an array. You need to add an [tt]EXTERNAL ARRAY[/tt] command in the called method. See the Help topic for [tt]EXTERNAL[/tt] for more information.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Notice: Even when you address arrays with square brackets, the compiler thinks of it as the name of a function, because square brackets are universal as array element index brackets, string delimiters and also delimit function parameters just like normal brackets: [tt]? version[1] , abs[-3][/tt]

Thus the compiler doesn't know you mean an array name and looks for a function.

At the top of the function using the passed in array put the EXTERNAL declaration and the compiler will notice and not put this on the errors list.

Bye, Olaf.
 
Note also that this "error" is actually a warning. The compile completes successfully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top