Environment Variables

The macro preprocessor also substitutes enviroment variables. This can be very useful in an IDE such as Latenite, which passes information to the build scripts in the form of environment variables.

Include environment variables by surrounding them with '[%' and '%]'. For example:

debug_lev   .equ    [%debug_level%]

You could set the variable debug_level on the command line by typing SET debug_level=4 (or whichever value you so wish). These are handled by the preprocessor, and work all over the place - inside string constants, as #define arguments... wherever they are needed, really. If you wish to use a string, you can escape it by surrounding the environment variable name with $dollar signs$, like this:

.echo "Your path variable is [%$PATH$%]\n"