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

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