James,
The QueryAddFile is an event that occurs right before a file is added to a project. To add file use Add() method of project's Files colection.
toProject.Files.Add(lcFile)
>
>I am trying to automaticly add prg files to my project before I build it. I have the following code that I call from the BeforeBuild event. The code runs fine and queryaddfile returns .t. but the files are not added.
>
>Thanks.
>
>
>DO addwebfiles WITH this
>
>
>Here is the code for addwebfiles.prg
>
>
>LPARAMETERS toProject
>LOCAL lnx,laFiles[1]
>
>lnLines = ADIR(laFiles,"source\wwClass\*.prg")
>FOR lnx = 1 TO ALEN(laFiles,1)
> *// lcFile = STRTRAN(FULLPATH(laFiles[lnx,1]),"d:\projects\realweb\","",1,1,1)
> lcFile = FULLPATH(laFiles[lnx,1])
>? toProject.queryaddfile(lcFile)
>NEXT
>
--sb--