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

change only .bas file - compile with older .vbp/.vbw? 4

Status
Not open for further replies.

swatsonvb

Programmer
Oct 9, 2002
2
US
I've looked through past posts and didn't find an answer to this question. Hopefully it hasn't been beaten to death previously.

Is it OK to change a *.bas (e.g. General.bas) file in a project and keep the old vbp and/or vbw file? In other words, will the project compile correctly with a new .bas file and older .vbp file if only code change is in .bas file?

Purpose: I have different vb projects with common code in .bas file. Change once, copy to other projects & recompile?

Thanks!
 
The .vbp file is only a text file (have a look at it in Notepad) so the link to the .bas file is evaluated as the .vbp file is loaded so the answer to your question is Yes it will work OK.

What is more you can reference the common .bas file directly in each project simply by adding it to the project (after first removing the reference to the local one). If you look at the .vbp file after this you will see that an absolute or relative path is used to identify the file.

This way you don't have to remember to copy the common .bas file around once you have changed it. All you have to do is recompile the projects that use it.

This principle also applies to .cls and .frm files.
 
Like bboffin says.

Also - if your directory structure is relatively static, you can create a Common directory that will hold files that are shared between multiple projects and point your .vbp at it.
[tt]
ProductRoot
|
+ Common
|
+ Project1
|
+ Project2
[/tt]
If one of the shared .bas files changes, the next time a project that depends on it is built, it will get the latest version automatically.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Thanks for the replies - all valuable info. that I will use!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top