Declaring a, "Module Constant", Public or Private?

J

John Phelan

The “access analyzer†program that I am using says that, “Module Constantsâ€
should be explicitly scoped†as either, “Publicâ€, or “Private in the
“Declarations Sectionâ€. The reference is to, “cCalendarDialogâ€. The
following is the first time this reference is picked up in the module:

Option Compare Database 'Use database order for string comparisons
Option Explicit
Const cCalendarDialog = "fdlgCal"

How do I, “explicitly scope “cCalendarDialog†as either, “Public†or
Private; and can I assume it would be, Private?

John
 
D

Douglas J. Steele

Public Const cCalendarDialog = "fdlgCal"

or

Private Const cCalendarDialog = "fdlgCal"

Yes, it's Private by default (which means that it can only be used within
that particular module)

To be honest, there's no real need to declare them as Private, other than
for self-documentation purposes.
 
J

John Phelan

Thanks for the info!

John

Douglas J. Steele said:
Public Const cCalendarDialog = "fdlgCal"

or

Private Const cCalendarDialog = "fdlgCal"

Yes, it's Private by default (which means that it can only be used within
that particular module)

To be honest, there's no real need to declare them as Private, other than
for self-documentation purposes.
 
Top