|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
BAS Module!I created a BAS module for a VB6 project. Then I used the same BAS
module in another project but altered it by deleting some existing code & adding new code & saved it. When I went back to the 1st project, I find that the changes in the BAS module that I had done in the 2nd project are getting reflected in the 1st project; I lost that part of the code in the BAS module that was meant for the 1st project. I thought that the 2 BAS modules will be saved independently since they belong to 2 different projects! Is there any way by which I can recover the original BAS module that was meant for the 1st project? Thanks, Arpan Arpan wrote:
> I created a BAS module for a VB6 project. Then I used the same BAS You might consider implementing some sort of backup scheme to help > module in another project but altered it by deleting some existing code > & adding new code & saved it. When I went back to the 1st project, I > find that the changes in the BAS module that I had done in the 2nd > project are getting reflected in the 1st project; I lost that part of > the code in the BAS module that was meant for the 1st project. I > thought that the 2 BAS modules will be saved independently since they > belong to 2 different projects! Is there any way by which I can recover > the original BAS module that was meant for the 1st project? > > Thanks, > Arpan protect each version of your source code, for every project you work on. This is what I do (and it's saved my a** on more occasions than I can count.) Keep each project in a unique folder. Manually copy any code from other projects that you want to include (modules, forms, classes etc.) into the project folder using Windows Explorer. Each time you finish working on a project, make a zip file of all of the source code, however minor the changes were, something like projectname_NN.zip. Using two digits in the name keeps them aligned nicely in Explorer if you get to projectname_10.zip. If there's a way to recover your lost .bas code, I don't know what it is. I know VB often leaves junk temp files on my hdd, maybe you could search the whole hdd for files that include some unique text from your module. Good Luck, Mike Probably not. There are no backups of files made by VB6 as you save
your code. You have to do this yourself from time to time. The Save As is really a mess in VB. it only really creates a copy of your VBP file. That Saved As VBP merely points to the same set of files as the first project. to keep things separated, if i'm going to build a second project based on all the great code created in some other project....i just copy the entire directory. at that point i'm sure to have two duplicate systems. then take that second one, and just rename the VBP file, or do the lame Save As on it. Then start deleting, changing BAS, FRM, CLS files as you need. If you want to share a tools type directory of common routines, you can have all your projects reference a Tools Directory. but even here you need to be careful, of course. you can check your VBP file using notepad, to verify where files are really coming from.. it will look like this. Form=frmMain.frm Form=..\..\Common\frmAbout.frm Form=..\..\Common\frmDisplayMemory.frm Form=..\..\Common\frmGenericQuery.frm Form=..\..\Common\frmLogin.frm Form=..\..\Common\frmWorking.frm Module=Globals; ..\..\Common\Globals.bas Module=utils; ..\..\Common\Utils.bas Class=clsErrLog; ..\..\Common\clsErrlog.cls Class=clsExcel; ..\..\Common\clsExcel.cls Class=clsHourglassCursor; ..\..\Common\clsHourglassCursor.cls Class=clsJetDatabase; ..\..\Common\clsJet.cls Module=PoleTrackerGlobals; PoleTracker.bas Form=frmAnalysePlanningDueDates.frm Form=frmPoleSourceCodesDefinition.frm Form=frmTUBatchAwardNoAssignment.frm Form=frmUpdatePlanningPackageStatus.frm Form=frmEditRecords.frm Form=frmImportDistributionProgressFiles.frm Form=frmPlanningPackageDefinition.frm Form=frmPlanningPackageAssignment.frm Form=frmReleaseNoDefinition.frm Form=frmReleaseNumberAssignment.frm Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\..\WINDOWS\System32\msstdfmt.dll#Microsoft Data Formatting Object Library Class=clsMSChart; ..\..\Common\clsMSChart.cls Object={65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0; mschrt20.ocx Form=frmChart.frm Form=frmCCExcelOutput.frm Form=frmBatchAwardNoDefinition.frm Form=..\..\..\Documents and Settings\John Santora\frmExportTUPlannerProgressFiles.frm Form=ImportExcelFiles.frm Form=frmOptions.frm Form=..\..\..\Documents and Settings\John Santora\frmExportConstructionProgressFiles.frm Class=clsGrid; ..\..\Common\clsGrid.cls Form=frmMaintainPlannerNames.frm Class=clsTableFieldNames; ..\..\Common\clsTableFieldNames.cls Form=..\..\Common\frmChartAGrid.frm Form=frmPoleSortCdDefinition.frm Form=frmExportPlannerProgressFiles.frm Form=frmDesignBatchAwardNoAssignment.frm Form=frmConstructBatchAwardNoAssignment.frm
Show quote
Hide quote
"Arpan" <arpan***@hotmail.com> wrote in message No.news:1129614492.851405.102310@g43g2000cwa.googlegroups.com... > I created a BAS module for a VB6 project. Then I used the same BAS > module in another project but altered it by deleting some existing code > & adding new code & saved it. When I went back to the 1st project, I > find that the changes in the BAS module that I had done in the 2nd > project are getting reflected in the 1st project; I lost that part of > the code in the BAS module that was meant for the 1st project. I > thought that the 2 BAS modules will be saved independently since they > belong to 2 different projects! Is there any way by which I can recover > the original BAS module that was meant for the 1st project? > > Thanks, > > Arpan > Does your version of VB include Visual SourceSafe (VSS)? If so activate it. There are several strategies you can employ to 'share' modules between projects. -ralph On 19 Oct 2005 12:07:28 -0700, "Arpan" <arpan***@hotmail.com> wrote: One useful thing is to keep an eye on the contents of the .VBP file>Thanks all of you for your suggestions. using a Text Editor Also to write a little batch file that zips all the files in a project, ideally in incrementing numbers. Also ideally onto another physical disk You could do worse than write a simple interrogator for the .VBP file that automates the process. |
|||||||||||||||||||||||