The difference between (x, x) and (x)(x) was a good catch. That distinction varies from language to language. I've been using JavaScript, and SQL, and I get mixed up from all that.
The purpose of Private is to make a function or a variable accesible only to the module in which it is declared. In practice it does not make a
lot of difference, but in returning later to code you wrote, it makes the intention clearer sometimes.
It is pretty useful in classes. Class-scope (analagous to 'module-scope,' but for classes) variables, and Functions and Subs (termed âmethodsâ in classes) declared with Private do not show up in the drop-down list (the intelli-sense list) when you are using the class.
A form's module is, in fact, a specialized class. Subs that interact only with the form itself are good candidates for Private (which is what
VB makes them, by default), though you can explicitly declare them Public, and call them from outside the form.
Also, if you have, for instance, a module named Fifi, and it has a private sub called Alpha, and a public sub named Beta, anywhere in code you can start out with âFifi.â, and an intelli-sense list of just âBetaâ will appear (Even within the module Fifi). It is not common to precede the names of routines with the name of the module in which they reside, but you can. And when you do, only the Public items will show in the intelli-sense list.
Lastly, if you write a routine that should only be used by items in a particular module, and you forget where you are and try to use it outside that module, if it is declared Private it will generate a compilation error.
This has been a fun challenge, Janis. Thanks for sticking with it.