Tom Borgmann
Programmer
Today I finally lost my patience with this message thats hunting me for decades because I often forget to do a CLEAR ALL in the commandwindow right before starting a compile.
About 10-15 years ago, when I wrote our projecthook class I had tried to get rid of this message by doing a CLEAR ALL within the BeforeBuild hook. But this brought up the message that my projecthook class were in use and couldn't be cleared.
So at that time I simply removed the CLEAR ALL and accepted that I'd have to do it in the commandwindow.
Today, after the 10 millionth time of forgetting the CLEAR ALL thing I finally had enough of it.
Searching the web brought up likewise problems, even here in tektips, but the answers didn't really help. So I took the projekthook out of our sourcecode archive, where it had slept for years and experimented a bit.
Now I'm using a small loop for all project files, check their suffix==[vcx] and do an explicit CLEAR CLASSLIB on the vcx file.
Problem solved and wondering why I didn't do that all those years ago *facepalm*
So, this is all that's needed in the BeforeBuild hook:
It is part of a bigger loop where unused bitmaps are removed from the project and therefore the loop works from bottom to top. However I cut that part out.
-Tom
About 10-15 years ago, when I wrote our projecthook class I had tried to get rid of this message by doing a CLEAR ALL within the BeforeBuild hook. But this brought up the message that my projecthook class were in use and couldn't be cleared.
So at that time I simply removed the CLEAR ALL and accepted that I'd have to do it in the commandwindow.
Today, after the 10 millionth time of forgetting the CLEAR ALL thing I finally had enough of it.
Searching the web brought up likewise problems, even here in tektips, but the answers didn't really help. So I took the projekthook out of our sourcecode archive, where it had slept for years and experimented a bit.
Now I'm using a small loop for all project files, check their suffix==[vcx] and do an explicit CLEAR CLASSLIB on the vcx file.
Problem solved and wondering why I didn't do that all those years ago *facepalm*
So, this is all that's needed in the BeforeBuild hook:
Code:
liFlag = _VFP.ActiveProject.Files.Count
liCont = 1
DO WHILE liCont = 1
TRY
IF LOWER( JUSTEXT( _VFP.ActiveProject.Files( liFlag ).Name ) ) == [vcx]
lcClasslib = _VFP.ActiveProject.Files( liFlag ).Name
CLEAR CLASSLIB &lcClasslib
ENDIF
CATCH
liCont = 0
ENDTRY
liFlag = liFlag - 1
ENDDO
It is part of a bigger loop where unused bitmaps are removed from the project and therefore the loop works from bottom to top. However I cut that part out.
-Tom