Constants

Often, you'll find that your macro contains constant values that reappear again and again. Or you may find that the macro depends on certain numbers that are difficult to remember — numbers that, in and of themselves, have no obvious meaning.

In these cases, you can greatly improve the readability of your macro — and make it easier to maintain — by using constants. A constant is a meaningful name that takes the place of a number or string that doesn't change. Although a constant somewhat resembles a variable, you cannot modify a constant or assign a new value to it as you can do with a variable. There are two sources for constants:

Tip

Use constants when you need to use the same value several times in your macro, or when you want to make your macro more readable by assigning a meaningful name to a value that doesn't change.