organizing a large macro

L

Liz

I'm writing a numbering suite for Word 2003. When testing my first
try, users found bugs and want more features. When I was writing it,
i found myself creating word tables documenting arrays, lists of
variables and code snippets. Now that I have to go back into the
macro, I realize that the hardest part is keeping my thinking
organized. Does anybody know an easy way to document and organize
this stuff? I've looked at UML but it seems like the learning curve is
pretty steep and most programs that use UML are not made for VBA.

thanks,

Liz
 
S

sparky191

I reckon if you write good code most of it is self explanatory. If you
make your subroutines and functions as small and generic as possible,
they should explain themselves.
 
C

Charles Kenyon

Just general programming techniques I learned 30 years ago:
Lots of comments.
Modular code.
A flow chart.

vba makes the commenting pretty easy. You can identify most variables when
you DIM them. (You do declare all your variables, don't you?) The Option
Explicit command is key.

To separate logical parts of my code, I add blank comment lines as well as a
comment header for each part.

For particularly long code, I would perhaps document in each module what
code calls the module. That is, when I write a call to the module or
function, I would add a comment in the called module. That way if I make
changes in the module, I know what to check to make sure it runs properly
with anything that calls it.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
L

Liz

From: (e-mail address removed) - view profile
I meant to ask. Do you mean organising the code or documenting it?

Organizing it.


From: Charles Kenyon - view profile
Just general programming techniques I learned 30 years ago:
Lots of comments.
Modular code.
A flow chart.

Do you create the flow chart in a particular program? any other tips
about creating a flow chart?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top