PDA

View Full Version : Form Bloat



chill3490
2004-07-06, 06:36 PM
From a Guild-based thread of a couple or so years back, I understand there was an issue with something called "form bloat".

Is this still an issue in AutoCAD 2004 VBA?

I would like to understand how to avoid or workaround this should it be prove problematic in my learning VBA.

Anything BUT DCL!!!!:roll:

Ed Jobe
2004-07-06, 06:59 PM
Its usually referred to a dvb bloat. There are two possible causes, both of which require an understanding of the makeup of a dvb. In regular vb, a project consists of separate files (e.g. *.prj, *.bas, *.cls, etc.). You have to compile the project in order to run it. In vba, everything is compiled into the dvb automatically.

The first cause of "bloat" is not really bloat at all. The pseudo code you see on the screen in the ide is normally saved as a bas file in vb. But in vba that, along with the binary compiled code is saved together. When you start a project, form etc., nothing has been compiled yet and the dvb file size is relatively small. When you close your project, it is compiled automatically. Some have noticed this and have gone to great lengths to reduce the file size, but this is normal. They may export to a frm or bas file and then import. This temporarily reduces the file size by stripping the compiled portion of the code, but then it immediately comes back when compiling takes place. This is nothing to worry about. One thing to take note of though, is that this is a common source for corrupt dvb's. If you have a compile error when you save and leave your project, you may experience a corrupt dvb. I avoid this by manually compiling (Debug menu>Compile) when I finish my programming session and before I save the project. This forces the ide to catch any compile errors and gives you a chance to fix them before you leave. This way you won't get any nasty surprizes and come back and find you can't even open your dvb.

The othe source of dvb bloat comes when you try to use controls that are licensed for vb and not vba. They may contain a huge amount of code that only applies to vb and thus bloat the dvb.