Visual Basic Stats:

How to support the site


Site Wide Message: (current site time 9/2/2010 4:11:12 PM EDT)
  • We want your input! One of our sponsors wants to know your opinion about development related issues. Click here to tell us what you think.
  • Are you an emerging/young developer (aged 18-30)? If so, would you like the chance to affect future developer tools and products?
    If so, then click here to give your feedback.
 

VB Project Cleaner

Print
Email
winzip icon
Submitted on: 8/26/2002 2:10:46 PM
By: Franco Gomes 
Level: Advanced
User Rating: By 25 Users
Compatibility:VB 6.0

Users have accessed this code  5062 times.
 
 
     (Version 1.0.5) This small program is not a VB project analyzer, but a VB project cleaner. The purpose is to search for all declarations, variables, constants and procedures unused on Visual Basic 6 projects. I made this program for my use, because I had necessity to free my projects of the accumulated garbage. After opened the VB Project, VB Project Cleaner creates a new folder (inside your project folder) named Clean_(and followed by your project Folder´s name), for where the project files, forms, modules and class modules, effectively used, are copied - it is the first step of cleanness. All the operations are processed on these duplicates, therefore, there is no risk to ruin the original code. After that, the program searchs for unused declarations. Depending on the choice made in [Remove unused code] and [Do not remove. Mark as comments] options, the unused code will be removed from the file or marked as a comment line. The program converts Dim declarations, made in declarations zone, to Private. Also, Public declarations, used only in the module where they are declared, are converted to Private. Format text code - with this option checked, the text code is formated. Add error handlers - error handlers are added to every procedure (except if there is already a error handler). If a error ocurs, a message box displays the error number, error description, name of the procedure and name of the module. Remove all comments - all comments are removed from the code.
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :VB Project Cleaner
'**************************************
Just one API declaration (to run the Help file)
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
8/27/2002 2:35:25 PMTom Law

When I first tried this on a particularly large app. I thought it seemed slow. Then I realised that it was in fact being extremely thorough. It found problems that I never knew I had. 5 globes and please let me know if you bring out any updates.
(If this comment was disrespectful, please report it.)

 
8/27/2002 8:31:15 PMkmchong

Excellent!! This is exactly what I am looking for and I think it can be regard as a code optimizer.

I will download and try, expected to have small problems, please keep me informed of any advancement,
can contact via my email

Thanks.. Thanks...Thanks A Lot

(If this comment was disrespectful, please report it.)

 
9/19/2002 5:29:53 AM

Pretty cool program, thanks a lot...

There is a minor bug, ReDim is read as Dim and will be marked/removed.
(If this comment was disrespectful, please report it.)

 
10/2/2002 6:35:04 AMmichael doering

very cool, 5 murbles from me.
(If this comment was disrespectful, please report it.)

 
10/13/2002 2:30:58 AM

Good job!

But, it shouldn't convert PUBLIC declarations in class modules to PRIVATE.
(If this comment was disrespectful, please report it.)

 
12/1/2002 9:16:06 AMPaulo Matoso

Excellent!!

Thanks
(If this comment was disrespectful, please report it.)

 
12/9/2002 7:30:09 PM

One problem, major enough to discourage me from using it again. Project Cleaner appears to remove all line continuation characters (i.e underscores, _), and concatenates the lines.

While the program still runs the same as before, it may be a whole lot less readable.


(If this comment was disrespectful, please report it.)

 
4/29/2003 2:51:24 PMDanny Pryor

Very nice ;0) ! All except for it replacing my line continuation's . It should go right so far , allow the line continuation and then push down a line . Worked very well with that exception in mind ( no big deal , just copy and paste from the original V.B.P. ;0) ) Any future update's please let me know . I enjoyed it.
(If this comment was disrespectful, please report it.)

 
6/4/2003 10:57:24 PMRussell Sanders

And you din't get code of the month
(If this comment was disrespectful, please report it.)

 
6/16/2003 12:01:06 PMTheWoot Software

You are a god.
(If this comment was disrespectful, please report it.)

 
6/8/2004 7:48:58 AMMartin Tonek

Interested of expand this little thing to be better and safer? Author? any other? I just Love this tool but have remaked som of the stuff
(If this comment was disrespectful, please report it.)

 
11/12/2004 5:18:45 PM

VERY nice i used this in my encryption code in which i kept changing variable names and such and worked very well to remove un-used variables and clean it up, 5 globes
(If this comment was disrespectful, please report it.)

 
7/10/2005 1:11:23 PMTravis Lapeyrouse

5 globes, if there were 6 then 6 globes.
Nice code.
(If this comment was disrespectful, please report it.)

 
9/3/2005 7:21:34 AMBrian Ail

Very good, but I dunno why afterall the stuffs in the project remain unchanged.
(If this comment was disrespectful, please report it.)

 
3/10/2006 2:57:34 PMkaotix

the major problem of it changing functions in class modules to Private is very annoying, also...it seems to remove some of my functions that clearly are in use. one of my major ones actually. it sits on its own in a module and gets called directly, is this a bug maybe?
(If this comment was disrespectful, please report it.)

 
8/2/2006 2:49:19 PMChe

This was very useful to me! I was about to make a program to do the same thing (to clean up my project). But, I decided to search first, and thank god! Very nice job, and it works perfect so far.
(If this comment was disrespectful, please report it.)

 
7/22/2008 3:01:43 AMSwannie

Well Done. 5 Globes from me.....
(If this comment was disrespectful, please report it.)

 
7/22/2008 3:03:28 AMSwannie

One Thing - Maybe add a report at the end that shows you all the changes that was made to the project.
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!

Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.