LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Naming conventions for variables

After about 20+ years working in xBase and VFP, I have been accustomed to a
naming convention which guarantees avoiding Key Words as names. I find very
little evidence of the existence of any STANDARD naming convention in VBA --
which I think is a pity.

The convention with which I am most familiar is a three part construct:

SCOPE + TYPE + NAME.

In VFP the scope choices a

g -- Public ("Global")
p -- Private
l -- Local

The types are like:

chr -- Character
int -- Integer

The name can be pretty well anything within reason. So a Character variable
with Private scope might have a name like:

pchrDoofus

... and an Integer variable with Public scope could be

gintBigNum

The only example I have seen anywhere so far in Excel has been one helpful
individual who used "rng" as the prefix for a Range name:

For Each rngCell In Range("K2", "K13")

So, my question is this: Is there a standardized Naming Convention for VBA?
Microsoft KnowledgeBase doesn't seem to think so, but I know that the VFP
community had the current one for years before MS adopted it. Perhaps all
y'all (I live in the Sahth (that, for the benefit of my Yankee friends, is
how we pronounce "South" down here) may have either a standard one to which
to refer me, or just a preferred private one you could share with me.
--
Dave
Temping with Staffmark
in Rock Hill, SC
--
Dave
Temping with Staffmark
in Rock Hill, SC
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File naming conventions gidget Excel Discussion (Misc queries) 7 November 15th 05 02:15 PM
plotting 2 variables as scatter and naming each point Jane Charts and Charting in Excel 1 June 22nd 05 03:55 PM
Naming Range Variables scott Excel Programming 6 January 7th 05 10:37 PM
Naming Variables Terri[_5_] Excel Programming 1 October 11th 04 04:16 PM
naming multiple public variables generated by single function Mark Kubicki Excel Programming 1 July 22nd 03 09:25 PM


All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"