global constants

S

smk23

If I have several constants specific to my application, does it make sense to
declare public constants in a module? Is there any downside to this?

For example, I often filter by a particular appointment type, let's say
ApptTypeID=2.
For code maintainability, wouldn't it be better to declare a public
constant, skOfficeAppt =2 and then my code would read ApptTypeID=skOfficeAppt

Is that good strategy?
Thanks!!
 
B

Brendan Reynolds

Global constants are good, yes. I use them extensively in my applications,
and keep them all in one module (I call it basConstants) so I know where to
find them.
 
J

John Nurick

Yes, it can be good strategy if you use that value often.

"Often" here has the technical meaning of "more than once"! (It kind of
makes sense, if you think binary<g>).
 
Top