Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2006

Tip: Looking for answers? Try searching our database.

variable naming conventions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zkid - 28 Jul 2006 18:25 GMT
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.
Helmut Weber - 28 Jul 2006 19:36 GMT
Hi,

google for:

Reddick VBA Naming Conventions

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

zkid - 28 Jul 2006 21:49 GMT
Thanks, Helmut.  You are a gem!

> Hi,
>
> google for:
>
> Reddick VBA Naming Conventions
Jonathan West - 31 Jul 2006 14:52 GMT
>I have seen people use int or just i, str or just s, etc., in front of
> variable names.
[quoted text clipped - 3 lines]
>
> 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.

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.