Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifiers in VB (Out of Memory)

Status
Not open for further replies.

mmilan

Programmer
Jan 22, 2002
839
GB
Hello One and All,

Just thought I should share with you all the outcome of an "out of memory" investigation that has been conducted by my department - names withheld to protect the guilty as sin...

Visual Basic has a limit on the number of identifiers that can be used in the same project, which appears to be 32,000. That's identifiers across the entire project by the way - not just those in scope at any particular time (32,000 in scope would be way too scary anyway!!!).

This is where it gets interesting though - multilple use of any particular identifier only seems to count once in this count - the moral of the story therefore being to try to reuse identifier names on large projects.

Our own main project (again, nameless...) heralds from the VB2-3 days, when you couldn't have two labels with the same idenitifier in the same module. Since we have error checking in absolutely every single function / procedure we write, this meant we had about 5'600 identifiers being used by On Error alone. (We developed a habit of making the Error label reflect the function name so as to prevent trying to reuse them).

We are now aiming to standardise all future development to use certain identifiers whereever possible. For example, cnt will be the first choice of variable name for a counter etc...

mmilan
 
Nope - which I admit is a bit of a farce.

That having been said, there are probably some people in here even worse than I, so hey - I thought it could do with a mention.

Got a Dunce cap I can borrow?

mmilan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top