zkid said:
I have seen people use int or just i, str or just s, etc., in front of
variable names.
It seems people have their own preferences. Does anyone know of a website
that provides proper varable naming conventions?
Thanks.
There is no single "proper" way. Simply remember that the code serves 2
purposes
1. it is a set of instructions for the computer
2. It is a message to yourself or your successor as to what you were trying
to get the computer to do.
Naming conventions are just that - conventions, and by definition more or
less arbitrary. Choose one which suits you and those you work with.
Having a naming convention that uses prefixes for variable types serves two
purposes.
- It enables you to immediately identify the type of a variable, and
therefore the range of things you can do to it.
- It more or less eliminates any chance that you will accidentally give a
variable the same name as an object within the Word object model.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition
www.classicvb.org