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

G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top