This command recompiles all classes, PRGs, reports, etc, in a project, and checks to make sure all references (to graphic files, to programs, to reports, to classes, etc) are resolved; any that aren't are searched for, and if found, are automatically added to the project. However, sometimes this automatic method is frustrating because the positions in the project of references that can't be resolved are not given (at least, not in VFP6). Here's a method of finding them.
I get this error when I try to build project ... I've pinned it down to one class library, and get the same error, "Unable to find Unknown AND" when issuing the command:
BUILD CLASSLIB Las.vcx
It doesn't provide a class, record number, or anything that would make it easier to pinpoint.
I've seen this before where there is a line using the AND boolean operator right before a parenthetical statement, ie:
if whatever ;
AND(this or that)
I don't remember if it only happened when the statement got messed up or if the parser couldn't follow multi line stuff, but I now have NO occurances of an "and" operator followed by "(" with no seperating spaces.
Any good suggestions? It's a rather large VCX/VCT, but I'm about to start splitting it into junk VCX's in a binary search for the offending class.
. . . Time goes by...
That did it... the offending line was:
if ( NOT THISFORM.a_memReg.mf_registr .or. ;
not THISFORM.a_plyReg.pf_registr )
and (THISFORM.a_PlyReg.pf_amt_due=0 or THISFORM.a_PlyReg.pf_FundDue=0)
(notice the missing ";")
It wasn't just a binary search of copying halves of LAS.VCX to another junk.VCX until the error occured in junk.VCX...
That pinpointed the class with the problem, but then I had to determine WHERE in the class the error was (It's a big class).
This method actually worked pretty quickly:
I just replaced all occurrances of "AND" which were part of a boolean statement, with "AND NOT NOT", then compiled and the one problem spot was a compile error because while:
is a valid function call,
AND NOT NOT(.t.)
See also: Whichone.prg tells you which file is erroring when building a project. Handy if the build does a C0.005 error, or for versions of VFP prior to 8.0. Find it at http://www.ml-consult.co.uk/foxst-31.htm. Expanded version from Barbara Peisch in
ErrorMessages.zip at http://www.peisch.com/downloads.html -- Ted Roche
Category VFP Commands
( Topic last updated: 2006.01.22 01:04:25 PM )