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

Re: organizing a large macro by sparky191

sparky191
Wed Mar 08 07:28:46 CST 2006

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.


Re: organizing a large macro by sparky191

sparky191
Wed Mar 08 08:06:47 CST 2006

I meant to ask. Do you mean organising the code or documenting it?


Re: organizing a large macro by Charles

Charles
Wed Mar 08 08:17:39 CST 2006

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.


"Liz" <lgewirtz5@yahoo.com> wrote in message
news:1141775537.103279.103170@u72g2000cwu.googlegroups.com...
> 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
>



Re: organizing a large macro by Liz

Liz
Wed Mar 08 09:55:07 CST 2006

From: sparky191@gmail.com - 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?